summary refs log tree commit diff
path: root/arm64
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin@c9x.me>2022-03-08 15:33:21 +0100
committerQuentin Carbonneaux <quentin@c9x.me>2022-03-08 15:36:26 +0100
commit349794f3e4f11e4cc34a501ba935a2a305229738 (patch)
tree3e858a2d3dbf8b4ad43cc5f2f40a8790b37b99b6 /arm64
parent3d294346ab168fd0b12761711fbe667e47fd644e (diff)
downloadroux-349794f3e4f11e4cc34a501ba935a2a305229738.tar.gz
cosmetics
Diffstat (limited to 'arm64')
-rw-r--r--arm64/abi.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/arm64/abi.c b/arm64/abi.c
index 18e8ef3..f127576 100644
--- a/arm64/abi.c
+++ b/arm64/abi.c
@@ -181,7 +181,7 @@ selret(Blk *b, Fn *fn)
 		cty = (cr.nfp << 2) | cr.ngp;
 		if (cr.class & Cptr) {
 			assert(rtype(fn->retr) == RTmp);
-			blit(fn->retr, 0, r, cr.t->size, fn);
+			blit0(fn->retr, r, cr.t->size, fn);
 		} else
 			ldregs(cr.reg, cr.cls, cr.nreg, r, fn);
 	} else {
@@ -359,6 +359,10 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp)
 		stkblob(i1->to, &cr, fn, ilp);
 		cty |= (cr.nfp << 2) | cr.ngp;
 		if (cr.class & Cptr) {
+			/* spill & rega expect calls to be
+			 * followed by copies from regs,
+			 * so we emit a dummy
+			 */
 			cty |= 1 << 13 | 1;
 			emit(Ocopy, Kw, R, TMP(R0), R);
 		} else {
@@ -407,7 +411,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp)
 			emit(Oadd, Kl, r, TMP(SP), getcon(off, fn));
 		}
 		if (i->op == Oargc)
-			blit(TMP(SP), off, i->arg[1], c->size, fn);
+			blit(TMP(SP), off, i->arg[1], 0, c->size, fn);
 		off += c->size;
 	}
 	if (stk)
@@ -415,7 +419,7 @@ selcall(Fn *fn, Ins *i0, Ins *i1, Insl **ilp)
 
 	for (i=i0, c=ca; i<i1; i++, c++)
 		if (c->class & Cptr)
-			blit(i->arg[0], 0, i->arg[1], c->t->size, fn);
+			blit0(i->arg[0], i->arg[1], c->t->size, fn);
 }
 
 static Params