aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/ir_abi0.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2026-03-25 16:36:29 +0100
committerlemon <lsof@mailbox.org>2026-03-25 16:36:29 +0100
commit79d6ac719042371d255ed1cf412e3232d13d1e56 (patch)
treef7d7ac5b94f68575bbfbf43f5f295c8a6c146b8f /src/ir_abi0.c
parent3eb74e33d9fb2fa1bfe3ba4757c79ed13330c104 (diff)
aarch64 struct arg passing ABI wip
Diffstat (limited to 'src/ir_abi0.c')
-rw-r--r--src/ir_abi0.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ir_abi0.c b/src/ir_abi0.c
index 74a9d62..8722438 100644
--- a/src/ir_abi0.c
+++ b/src/ir_abi0.c
@@ -45,8 +45,13 @@ abiarg(ABIArgVec *abiargs, uchar *r2off, int *ni, int *nf, int *ns, IRType ty)
int ret = mctarg->abiarg(r, cls, r2off, ni, nf, ns, ty);
if (!ret) { /* in stack */
vpush(abiargs, ((ABIArg) { ty, .isstk = 1, .stk = r[0] }));
- } else if (ret == 1 && ty.isagg && cls[0] == KPTR) { /* aggregate by pointer */
- vpush(abiargs, ((ABIArg) { cls2type(cls[0]), .reg = r[0] }));
+ } else if (ty.isagg && cls[0] == KPTR) { /* aggregate by pointer */
+ ABIArg a = { cls2type(KPTR) };
+ if (ret < 0) /* stack */
+ a.isstk = 1, a.stk = r[0];
+ else /* reg */
+ a.isstk = 0, a.reg = r[0];
+ vpush(abiargs, a);
} else { /* by regs */
vpush(abiargs, ((ABIArg) { cls2type(cls[0]), .reg = r[0] }));
if (ret == 2)