commit 1abed68cc3b14606d83d8b0ad7d2b5855c8801df
parent fd31290dd37cfd8f7ba765eb330d719bafba42f0
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date: Thu, 20 Aug 2015 11:56:48 -0400
change cmp $0, %reg, to test %reg, %reg
Diffstat:
1 file changed, 5 insertions(+), 0 deletions(-)
diff --git a/lisc/emit.c b/lisc/emit.c
@@ -261,6 +261,11 @@ eins(Ins i, Fn *fn, FILE *f)
break;
case OXCmpw:
case OXCmpl:
+ if (rtype(i.arg[1]) == RTmp && req(i.arg[0], CON_Z)) {
+ eop("test", i.arg[1], i.arg[1], fn, f);
+ break;
+ }
+ /* fall through */
case OXTestw:
case OXTestl:
eop(otoa[i.op], i.arg[0], i.arg[1], fn, f);