diff options
author | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-08-04 19:39:01 -0400 |
---|---|---|
committer | Quentin Carbonneaux <quentin.carbonneaux@yale.edu> | 2015-09-15 23:01:30 -0400 |
commit | 1477dffe32ae769c15ee49e77c5f0856bd0f56ea (patch) | |
tree | 60a3e6602227b8c2cb3141a43e5c8e82cb18cd8d | |
parent | df358ad6d21502568df9f937788f3fab6a81e047 (diff) | |
download | roux-1477dffe32ae769c15ee49e77c5f0856bd0f56ea.tar.gz |
use cmp $0, it works with spill slots
-rw-r--r-- | lisc/emit.c | 6 | ||||
-rw-r--r-- | lisc/spill.c | 2 |
2 files changed, 5 insertions, 3 deletions
diff --git a/lisc/emit.c b/lisc/emit.c index 8a8d3e7..a014727 100644 --- a/lisc/emit.c +++ b/lisc/emit.c @@ -168,14 +168,14 @@ emitfn(Fn *fn, FILE *f) break; case JJez: if (b->s1 == b->link) { - js = "jnz"; + js = "jne"; s = b->s2; } else if (b->s2 == b->link) { - js = "jz"; + js = "je"; s = b->s1; } else diag("emit: unhandled jump (1)"); - eop("test", b->jmp.arg, b->jmp.arg, fn, f); + eop("cmp $0,", b->jmp.arg, R, fn, f); fprintf(f, "\t%s .L%s\n", js, s->name); break; default: diff --git a/lisc/spill.c b/lisc/spill.c index 64200af..30adb35 100644 --- a/lisc/spill.c +++ b/lisc/spill.c @@ -334,6 +334,7 @@ spill(Fn *fn) assert(bcnt(&v) <= nreg); /* 2. process the block instructions */ +#if 0 if (rtype(b->jmp.arg) == RTmp) { j = b->jmp.arg.val; if (!BGET(v, j) && l==nreg) { @@ -342,6 +343,7 @@ spill(Fn *fn) } BSET(v, j); } +#endif curi = &insb[NIns]; for (i=&b->ins[b->nins]; i!=b->ins;) { assert(bcnt(&v) <= nreg); |