diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-08-20 11:56:48 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-15 23:01:32 -0400 |
commit | 1abed68cc3b14606d83d8b0ad7d2b5855c8801df (patch) | |
tree | 5dd125c3da2495d10798929be36e5d64960aabe1 | |
parent | fd31290dd37cfd8f7ba765eb330d719bafba42f0 (diff) | |
download | roux-1abed68cc3b14606d83d8b0ad7d2b5855c8801df.tar.gz |
change cmp $0, %reg, to test %reg, %reg
-rw-r--r-- | lisc/emit.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/lisc/emit.c b/lisc/emit.c index 59b439b..278f579 100644 --- 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); |