aboutsummaryrefslogtreecommitdiffhomepage
path: root/amd64/isel.c
diff options
context:
space:
mode:
authorlemon <lsof@mailbox.org>2025-11-23 12:02:27 +0100
committerlemon <lsof@mailbox.org>2025-11-23 15:29:55 +0100
commit1f72464c6451fcff16180d00af537225acc9b83c (patch)
tree3ea1d99164f990fb2ce331abbf44de2a0db48f25 /amd64/isel.c
parentf4488e9153a4ead6f427902237cca93c67fec2bd (diff)
implement float varargs, and some other fixes
Diffstat (limited to 'amd64/isel.c')
-rw-r--r--amd64/isel.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/amd64/isel.c b/amd64/isel.c
index 9606c87..51a58db 100644
--- a/amd64/isel.c
+++ b/amd64/isel.c
@@ -141,6 +141,12 @@ selcall(struct function *fn, struct instr *ins, struct block *blk, int *curi)
} else {
union ref adr = mkaddr((struct addr){mkref(RREG, RSP), .disp = abi.stk});
*arg = mkinstr(Ostore8+ilog2(cls2siz[abi.ty.cls]), 0, adr, arg->r);
+ int iargsave = iarg;
+ if (isaddrcon(arg->r,1) || arg->r.t == RADDR)
+ arg->r = insertinstr(blk, iarg++, mkinstr(Ocopy, abi.ty.cls, arg->r));
+ else
+ fixarg(&ins->r, ins, blk, &iarg);
+ *curi += iarg - iargsave;
}
}
if (call->argstksiz) {