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 /lisc/emit.c | |
parent | df358ad6d21502568df9f937788f3fab6a81e047 (diff) | |
download | roux-1477dffe32ae769c15ee49e77c5f0856bd0f56ea.tar.gz |
use cmp $0, it works with spill slots
Diffstat (limited to 'lisc/emit.c')
-rw-r--r-- | lisc/emit.c | 6 |
1 files changed, 3 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: |