rv64: handle slots in jnz

This commit is contained in:
Quentin Carbonneaux 2026-01-05 14:57:16 +01:00
parent 6a2dca8b99
commit 112cc1b824

View File

@ -444,7 +444,7 @@ rv64_emitfn(Fn *fn, FILE *f)
static int id0; static int id0;
int lbl, neg, off, frame, *pr, r; int lbl, neg, off, frame, *pr, r;
Blk *b, *s; Blk *b, *s;
Ins *i; Ins *i, ii;
emitfnlnk(fn->name, &fn->lnk, f); emitfnlnk(fn->name, &fn->lnk, f);
@ -549,6 +549,11 @@ rv64_emitfn(Fn *fn, FILE *f)
b->s2 = s; b->s2 = s;
neg = 1; 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)); assert(isreg(b->jmp.arg));
fprintf(f, fprintf(f,
"\tb%sz %s, .L%d\n", "\tb%sz %s, .L%d\n",