public inbox for libffi-discuss@sourceware.org
 help / color / mirror / Atom feed
From: Anthony Green <green@moxielogic.com>
To: DJ Delorie <dj@redhat.com>
Cc: libffi-discuss <libffi-discuss@sourceware.org>
Subject: Re: Change in libffi behaviour -- large struct args
Date: Tue, 31 May 2022 14:59:03 -0400	[thread overview]
Message-ID: <CACxje5-nDE_2zvwhjqri-0jq6v8KjqEt2nvvg-a1X68yPKtAGg@mail.gmail.com> (raw)
In-Reply-To: <xn1qw9snp6.fsf@greed.delorie.com>

On Tue, May 31, 2022 at 11:53 AM DJ Delorie <dj@redhat.com> wrote:
> While this is technically an ABI change, if the "old" ABI never worked,
> I can't see how this would break anything by changing.

I wouldn't even call this an ABI change.   The new implementation will
be ABI compatible.  This is really a bug fix.   In fact, some ports
have always done the right thing.

> I will add that passing structs is likely more complex than you think ;-)

The rules about passing small structs in registers can be complex, but
libffi always did that right.  AFAICT, the only complexity around
passing large structs in memory has to do with structure alignment,
but we have all of the info needed to do that right.

I really think this is worth fixing, even after all of these years.
Users currently need to know the threshold size for structures to pass
in memory vs registers, and this varies per target, and per ABI.
It's an abstraction leak that we can easily fix without causing too
much pain (if any).

AG

  parent reply	other threads:[~2022-05-31 18:59 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-28 13:40 Anthony Green
2022-05-28 15:38 ` dancol
2022-05-28 15:50   ` Anthony Green
2022-05-29 14:09 ` Anthony Green
2022-05-31 15:53 ` DJ Delorie
2022-05-31 16:47   ` dancol
2022-05-31 16:55     ` Kaz Kylheku
2022-05-31 18:59   ` Anthony Green [this message]
2022-05-31 23:16     ` DJ Delorie

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=CACxje5-nDE_2zvwhjqri-0jq6v8KjqEt2nvvg-a1X68yPKtAGg@mail.gmail.com \
    --to=green@moxielogic.com \
    --cc=dj@redhat.com \
    --cc=libffi-discuss@sourceware.org \
    /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).