public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
From: Paul Koning <paulkoning@comcast.net>
To: Iain Sandoe <iain@sandoe.co.uk>
Cc: GCC Development <gcc@gcc.gnu.org>
Subject: Re: Help with an ABI peculiarity
Date: Fri, 7 Jan 2022 16:55:06 -0500	[thread overview]
Message-ID: <DB1CB1BA-486C-4940-B824-FEC2ED9AD7EE@comcast.net> (raw)
In-Reply-To: <CD187C76-0620-457C-A0B7-B4ADBB6014FB@sandoe.co.uk>



> On Jan 7, 2022, at 4:06 PM, Iain Sandoe <iain@sandoe.co.uk> 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).

	paul



  reply	other threads:[~2022-01-07 21:55 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-07 21:06 Iain Sandoe
2022-01-07 21:55 ` Paul Koning [this message]
2022-01-08 16:35   ` Jeff Law
2022-01-10  8:38     ` Florian Weimer
2022-01-10 13:27       ` Iain Sandoe
2022-01-10 13:46         ` Florian Weimer
2022-01-11 12:53         ` Eric Gallager
2022-01-11 11:57       ` Richard Earnshaw
2022-01-10 10:46 ` Richard Sandiford
2022-01-10 13:06   ` Iain Sandoe
2022-01-20 22:32     ` Richard Sandiford
2022-01-21 11:19       ` Iain Sandoe
2022-01-21 12:22         ` Richard Sandiford

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DB1CB1BA-486C-4940-B824-FEC2ED9AD7EE@comcast.net \
    --to=paulkoning@comcast.net \
    --cc=gcc@gcc.gnu.org \
    --cc=iain@sandoe.co.uk \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).