From 26c1c30b7d96d2170195970a8cdb3b024ba7421a Mon Sep 17 00:00:00 2001 From: Quentin Carbonneaux Date: Sat, 10 Dec 2022 23:16:21 +0100 Subject: new blit instruction --- amd64/sysv.c | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) (limited to 'amd64') diff --git a/amd64/sysv.c b/amd64/sysv.c index f4e0416..04dfd83 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -127,7 +127,8 @@ selret(Blk *b, Fn *fn) if (aret.inmem) { assert(rtype(fn->retr) == RTmp); emit(Ocopy, Kl, TMP(RAX), fn->retr, R); - blit0(fn->retr, r0, aret.type->size, fn); + emit(Oblit1, 0, R, INT(aret.type->size), R); + emit(Oblit0, 0, R, r0, fn->retr); ca = 1; } else { ca = retr(reg, &aret); @@ -410,15 +411,15 @@ selcall(Fn *fn, Ins *i0, Ins *i1, RAlloc **rap) for (i=i0, a=ac, off=0; iop >= Oarge || !a->inmem) continue; + r1 = newtmp("abi", Kl, fn); if (i->op == Oargc) { if (a->align == 4) off += off & 15; - blit(r, off, i->arg[1], 0, a->type->size, fn); - } else { - r1 = newtmp("abi", Kl, fn); + emit(Oblit1, 0, R, INT(a->type->size), R); + emit(Oblit0, 0, R, i->arg[1], r1); + } else emit(Ostorel, 0, R, i->arg[0], r1); - emit(Oadd, Kl, r1, r, getcon(off, fn)); - } + emit(Oadd, Kl, r1, r, getcon(off, fn)); off += a->size; } emit(Osalloc, Kl, r, getcon(stk, fn), R); -- cgit 1.4.1