summary refs log tree commit diff
path: root/lisc/emit.c
diff options
context:
space:
mode:
Diffstat (limited to 'lisc/emit.c')
-rw-r--r--lisc/emit.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/lisc/emit.c b/lisc/emit.c
index 00bce4b..3e03a81 100644
--- a/lisc/emit.c
+++ b/lisc/emit.c
@@ -145,6 +145,10 @@ eins(Ins i, Fn *fn, FILE *f)
 		[OLoadus] = "movzw",
 		[OLoadsb] = "movsb",
 		[OLoadub] = "movzb",
+		[OXCmpw]  = "cmpl",
+		[OXCmpl]  = "cmpq",
+		[OXTestw] = "testl",
+		[OXTestl] = "testq",
 	};
 	static char *stoa[] = {
 		[OStorel - OStorel] = "q",
@@ -240,8 +244,9 @@ eins(Ins i, Fn *fn, FILE *f)
 		break;
 	case OXCmpw:
 	case OXCmpl:
-		eop(i.op == OXCmpw ? "cmpl" : "cmpq",
-			i.arg[0], i.arg[1], fn, f);
+	case OXTestw:
+	case OXTestl:
+		eop(otoa[i.op], i.arg[0], i.arg[1], fn, f);
 		break;
 	case ONop:
 		break;