aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux <[email protected]>2026-01-05 14:57:16 +0100
committerQuentin Carbonneaux <[email protected]>2026-01-13 17:09:41 +0100
commit112cc1b824bce527f19b9df3505b397fb082e20d (patch)
treee887efa5d4432efacf787c293e31afc708bfe105
parent6a2dca8b9986bd51be1617c68f1039db5d198243 (diff)
rv64: handle slots in jnz
-rw-r--r--rv64/emit.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/rv64/emit.c b/rv64/emit.c
index 39b55ea..c1f29ac 100644
--- a/rv64/emit.c
+++ b/rv64/emit.c
@@ -444,7 +444,7 @@ rv64_emitfn(Fn *fn, FILE *f)
static int id0;
int lbl, neg, off, frame, *pr, r;
Blk *b, *s;
- Ins *i;
+ Ins *i, ii;
emitfnlnk(fn->name, &fn->lnk, f);
@@ -549,6 +549,11 @@ rv64_emitfn(Fn *fn, FILE *f)
b->s2 = s;
neg = 1;
}
+ if (rtype(b->jmp.arg) == RSlot) {
+ ii.arg[0] = b->jmp.arg;
+ emitf("lw t6, %M0", &ii, fn, f);
+ b->jmp.arg = TMP(T6);
+ }
assert(isreg(b->jmp.arg));
fprintf(f,
"\tb%sz %s, .L%d\n",