diff options
| author | 2023-06-20 22:31:40 +0200 | |
|---|---|---|
| committer | 2023-06-20 22:31:43 +0200 | |
| commit | 2e4d5123544b86ec13e166dc94da43c850a588f2 (patch) | |
| tree | 6d47e28c3f9db8f0440238af640b830b9a355697 /amd64/sysv.c | |
| parent | 7fa68005dde6d1468ac7611c513a492292c48992 (diff) | |
amd64: fix aggregate return in regs
Diffstat (limited to 'amd64/sysv.c')
| -rw-r--r-- | amd64/sysv.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/amd64/sysv.c b/amd64/sysv.c index 8c95388..9c7bc15 100644 --- a/amd64/sysv.c +++ b/amd64/sysv.c @@ -120,12 +120,12 @@ abiret(short r[2], uchar cls[2], int *ni, union irtype typ) return 0; } assert(ret <= 2); - for (int i = 0; i < ret; ++i) { + for (int i = 0, ni = 0, nf = 0; i < ret; ++i) { assert(cls[i]); if (cls[i] == KF8) /* SSE (XMM0, XMM1) */ - r[i] = XMM0 + i; + r[i] = XMM0 + nf++; else if (cls[i] == KI8) /* INTEGER (RAX, RDX) */ - r[i] = i == 0 ? RAX : RDX; + r[i] = ni++ == 0 ? RAX : RDX; else assert(0); } return ret; |