diff options
| author | 2026-03-21 22:20:34 +0100 | |
|---|---|---|
| committer | 2026-03-22 10:49:26 +0100 | |
| commit | 79874c83bf76a5b3efd3d558933b90d9b53b829e (patch) | |
| tree | 566930a17f1e090f86c2051ffec33106012908eb /src/ir_intrin.c | |
| parent | 83342d3b60438ef2421160a0673fb45d48b2f39f (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_intrin.c')
| -rw-r--r-- | src/ir_intrin.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/ir_intrin.c b/src/ir_intrin.c index 6c73784..e2ea1d0 100644 --- a/src/ir_intrin.c +++ b/src/ir_intrin.c @@ -24,7 +24,7 @@ intrin(Block *blk, int *curi, enum intrin in, Arg *args, int narg, IRType ret) /* memcpy */ *args[1].ty = *args[0].ty = mktyperef(cls2type(KPTR)); insertinstr(blk, (*curi)++, mkarginstr(cls2type(cls), mkintcon(cls, td->siz))); - *this = mkinstr(Ocall, 0, mksymref(intern("memcpy"), SFUNC), this->r); + *this = mkinstr2(Ocall, 0, mksymref(intern("memcpy"), SFUNC), this->r); calltab.p[this->r.i].narg = 3; calltab.p[this->r.i].ret = cls2type(0); return 0; @@ -33,11 +33,11 @@ intrin(Block *blk, int *curi, enum intrin in, Arg *args, int narg, IRType ret) for (int off = 0; off < td->siz; off += step) { Ref psrc = *args[1].arg, pdst = *args[0].arg, src; if (off) { - pdst = insertinstr(blk, ++*curi, mkinstr(Oadd, KPTR, *args[0].arg, mkref(RICON, off))); - psrc = insertinstr(blk, ++*curi, mkinstr(Oadd, KPTR, *args[1].arg, mkref(RICON, off))); + pdst = insertinstr(blk, ++*curi, mkinstr2(Oadd, KPTR, *args[0].arg, mkref(RICON, off))); + psrc = insertinstr(blk, ++*curi, mkinstr2(Oadd, KPTR, *args[1].arg, mkref(RICON, off))); } - src = insertinstr(blk, ++*curi, mkinstr(Oloads8 + 2*ilog2(step), step < 8 ? KI32 : KI64, psrc)); - insertinstr(blk, ++*curi, mkinstr(Ostorei8 + ilog2(step), 0, pdst, src)); + src = insertinstr(blk, ++*curi, mkinstr1(Oloads8 + 2*ilog2(step), step < 8 ? KI32 : KI64, psrc)); + insertinstr(blk, ++*curi, mkinstr2(Ostorei8 + ilog2(step), 0, pdst, src)); } return 1; } |