Help with an ABI peculiarity

Paul Koning
Fri Jan 7 21:55:06 GMT 2022

> On Jan 7, 2022, at 4:06 PM, Iain Sandoe <> wrote:
> Hi Folks,
> In the aarch64 Darwin ABI we have an unusual (OK, several unusual) feature of the calling convention.
> When an argument is passed *in a register* and it is integral and less than SI it is promoted (with appropriate signedness) to SI.  This applies when the function parm is named only.
> When the same argument would be placed on the stack (i.e. we ran out of registers) - it occupies its natural size, and is naturally aligned (so, for instance, 3 QI values could be passed as 3 registers - promoted to SI .. or packed into three adjacent bytes on the stack)..
> The key is that we need to know that the argument will be placed in a register before we decide whether to promote it.
> (similarly, the promotion is not done in the callee for the in-register case).
> I am trying to figure out where to implement this.

I don't remember the MIPS machinery well enough, but is that a similar case?  It too has register arguments (4 or 8 of them) along with stack arguments (for the rest).


More information about the Gcc mailing list