This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: RFC: Extend x86-64 psABI for 256bit AVX register
- From: Jan Hubicka <hubicka at ucw dot cz>
- To: Jakub Jelinek <jakub at redhat dot com>
- Cc: "H.J. Lu" <hjl dot tools at gmail dot com>, Jan Hubicka <jh at suse dot cz>, discuss at x86-64 dot org, GCC <gcc at gcc dot gnu dot org>, "Girkar, Milind" <milind dot girkar at intel dot com>, "Dmitriev, Serguei N" <serguei dot n dot dmitriev at intel dot com>, "Kreitzer, David L" <david dot l dot kreitzer at intel dot com>
- Date: Mon, 16 Jun 2008 03:49:13 +0200
- Subject: Re: RFC: Extend x86-64 psABI for 256bit AVX register
- References: <20080609144054.GA13869@atrey.karlin.mff.cuni.cz> <20080610113921.GX3726@sunsite.mff.cuni.cz> <20080610113220.GD13869@atrey.karlin.mff.cuni.cz> <6dc9ffc80806100647p2c199dbcj5a3650ad97837c63@mail.gmail.com> <20080610145014.GH17032@kam.mff.cuni.cz> <20080610151122.GZ3726@sunsite.mff.cuni.cz> <6dc9ffc80806100841s291c8491g16767b36aac9a796@mail.gmail.com> <20080610154857.GE20774@kam.mff.cuni.cz> <20080611144912.GA7049@lucon.org> <20080615225203.GA9026@sunsite.mff.cuni.cz>
> On Wed, Jun 11, 2008 at 07:49:12AM -0700, H.J. Lu wrote:
> > > I guess we all agree on passing variadic arguments on stack (that is
> > > only those belonging on ...) and rest in registers. It seems easiest in
> > > regard to future register set extensions too. Only negative thing is
> > > that calls to variadic functions will become bit longer, but I guess it
> > > is not big deal. (the fact that register passing conventions are shorter
> > > and variadic functions tends to be called many times was also original
> > > motivation to support register passing on pretty much everything for
> > > varargs in psABI)
> > >
> >
> > There is no precedent for passing named parameters in registers but
> > unnamed parameters on the stack. On IA32 for the __m128 types, we
> > pass ALL __m128 parameters on the stack for varargs functions, not
> > just the unnamed ones. I think we should do the same for x86-64.
>
> Why should the 32-bit ABI influence x86-64 ABI decisions?
> There are clear advantages of passing __m128 named arguments in registers
> (shorter/faster code both on the caller and callee side) and there
> are advantages of passing __m128 unnamed arguments on the stack
> (for va_arg to work, they need to be on the stack, and if they
> are passed in registers, the callee would need to push them
> to the stack).
For record I would also preffer passing all named AVX arguments in
registers. x86-64 ABI was designed for performance not for backward
compatibility, so it should be consistent with original idea and I think
that ABIs are divergent anough so this won't cause too much of extra
confussion. But I am happy with both solutions.
Honza
>
> Jakub