diff options
| author | 2026-03-25 16:36:29 +0100 | |
|---|---|---|
| committer | 2026-03-25 16:36:29 +0100 | |
| commit | 79d6ac719042371d255ed1cf412e3232d13d1e56 (patch) | |
| tree | f7d7ac5b94f68575bbfbf43f5f295c8a6c146b8f /src/ir_abi0.c | |
| parent | 3eb74e33d9fb2fa1bfe3ba4757c79ed13330c104 (diff) | |
aarch64 struct arg passing ABI wip
Diffstat (limited to 'src/ir_abi0.c')
| -rw-r--r-- | src/ir_abi0.c | 9 |
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) |