aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ir_builder.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2026-03-21 22:20:34 +0100
committerlemon <lsof@mailbox.org>2026-03-22 10:49:26 +0100
commit79874c83bf76a5b3efd3d558933b90d9b53b829e (patch)
tree566930a17f1e090f86c2051ffec33106012908eb /src/ir_builder.c
parent83342d3b60438ef2421160a0673fb45d48b2f39f (diff)
IR: add 3rd operand to Instr
The motivation is for aarch64 msub/madd instrs, for isel to produce. But it should be useful for other things too.
Diffstat (limited to 'src/ir_builder.c')
-rw-r--r--src/ir_builder.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/ir_builder.c b/src/ir_builder.c
index 0c4b910..7f46574 100644
--- a/src/ir_builder.c
+++ b/src/ir_builder.c
@@ -100,7 +100,7 @@ irbinop(Function *fn, enum op op, enum irclass k, Ref l, Ref r)
default:
assert(!"binop?");
}
- return fn ? addinstr(fn, mkinstr(op, k, l, r)) : NOREF;
+ return fn ? addinstr(fn, mkinstr2(op, k, l, r)) : NOREF;
}
/* implements f32/f64 -> u64 conversion */
@@ -195,7 +195,7 @@ irunop(Function *fn, enum op op, enum irclass k, Ref a)
break;
default: assert(!"unop?");
}
- return fn ? addinstr(fn, mkinstr(op, k, a)) : NOREF;
+ return fn ? addinstr(fn, mkinstr1(op, k, a)) : NOREF;
}
int allocinstr(void);
@@ -242,7 +242,7 @@ addphi(Function *fn, enum irclass cls, Ref *r)
vpush(&phitab, refs);
/*assert(fn->curblk->ins.n == 0);*/
int new = allocinstr();
- instrtab[new] = mkinstr(Ophi, cls, .l.i = phitab.n-1);
+ instrtab[new] = mkinstr1(Ophi, cls, {.i=phitab.n-1});
for (int i = 0; i < fn->curblk->npred; ++i) {
adduse(fn->curblk, new, r[i]);
}