From: Richard Sandiford <rsandifo@redhat.com>
To: Dominic Sweetman <dom@mips.com>
Cc: Jun Sun <jsun@mvista.com>, linux-mips@linux-mips.org
Subject: Re: anybody tried NPTL?
Date: Wed, 01 Sep 2004 10:17:44 +0100 [thread overview]
Message-ID: <87zn4apcuf.fsf@redhat.com> (raw)
In-Reply-To: <16676.46694.564448.344602@arsenal.mips.com> (Dominic Sweetman's message of "Thu, 19 Aug 2004 15:17:10 +0100")
Dominic Sweetman <dom@mips.com> writes:
> In many ways it's easier to get away from the ingenious but
> troublesome stack-structure-based calling convention. The "stack
> structure" trick was invented so that o32 could work without function
> prototypes - but function prototypes are now required, and something
> with fixed-size arguments is simpler. Something like the old
> Cygnus/WRS EABI proposal, in fact...
Indeed, all of this:
> So we're proposing:
> [...]
> o Calling convention: register-, not slot-based. Each argument is
> represented by a register value. Arguments 0-7 travel in registers
> a0-7 (or fa0-7 as required for floating point types). If there are
> more than eight arguments, further ones are formed as if put in a
> register and then saved on the stack into a 64-bit slot (more than 8
> arguments is rare enough that we can afford to standardise on the
> big slots).
>
> o Use floating point registers for double and float arguments, and
> integer registers for all integer/pointer values which will
> fit. Larger or structured data items are implicitly passed by
> reference: to maintain pass-by-value semantics, the compiler uses a
> copy-on-write trick if software writes a by-reference argument (or
> takes its address). I'm told gcc is happy enough to do that.
>
> o The return value comes back in two registers, with the second
> return-register used only when the return value consists of two
> scalars (ie a complex or double-precision number). [Folklore insists
> this is essential for Fortran support of complex numbers, and I
> don't want to fight folklore].
>
> All other non-scalar return values are returned via a pointer
> specified by the caller as an implicit first argument.
>
> o Reserved registers: all the traditional ones. But now:
>
> - gp will be the GOT pointer in Linux, and should be defined as
> saved (ie a function must preserve values in this registers, which
> means it will need to save-and-restore the register if it is
> written locally).
...are pretty much what we already do for EABI. There's some fuzziness
in what EABI considers to be "double and float arguments": things like
"struct { float f; }" are passed in the same way as scalar floats, for
example. Complex integers are also returned by invisible reference
rather than in two GPRs. But these are very much corner cases.
Rather than define new, slightly different, conventions, have you thought
about defining this new ABI as an extension of EABI? I.e. taking EABI,
adding n32/n64-style PIC, and the all-important:
> - we'll define some other register as a per-thread data pointer.
Richard
prev parent reply other threads:[~2004-09-01 9:18 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-08-04 22:29 anybody tried NPTL? Jun Sun
2004-08-05 1:08 ` Kumba
2004-08-05 17:14 ` Jun Sun
2004-08-06 2:03 ` Ralf Baechle
2004-08-19 14:17 ` Dominic Sweetman
2004-08-19 14:31 ` Alec Voropay
2004-08-19 14:31 ` Alec Voropay
2004-08-20 6:07 ` Dominic Sweetman
2004-08-20 6:07 ` Dominic Sweetman
2004-08-23 12:28 ` Ralf Baechle
2004-08-23 15:09 ` Alec Voropay
2004-08-23 15:09 ` Alec Voropay
2004-08-23 17:19 ` Ralf Baechle
2004-08-19 16:01 ` David Daney
2004-08-20 6:19 ` Dominic Sweetman
2004-08-19 22:16 ` Jun Sun
2004-08-20 13:46 ` Dominic Sweetman
2004-08-23 13:28 ` Daniel Jacobowitz
2004-08-23 17:12 ` Ralf Baechle
2004-08-23 17:44 ` Daniel Jacobowitz
2004-08-23 19:13 ` Ralf Baechle
2004-08-23 17:37 ` Jun Sun
2004-08-23 19:25 ` Ralf Baechle
2004-08-20 13:12 ` Thiemo Seufer
2004-08-20 16:52 ` Dominic Sweetman
2004-09-01 9:17 ` Richard Sandiford [this message]
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=87zn4apcuf.fsf@redhat.com \
--to=rsandifo@redhat.com \
--cc=dom@mips.com \
--cc=jsun@mvista.com \
--cc=linux-mips@linux-mips.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.