Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Thiago Jung Bauermann <bauerman@br.ibm.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: gdb-patches@sourceware.org
Subject: Re: [RFA] Fix float argument passing in inferior function calls 	for ppc64
Date: Tue, 15 Jan 2008 17:40:00 -0000	[thread overview]
Message-ID: <1200418789.3158.71.camel@localhost.localdomain> (raw)
In-Reply-To: <200801151443.m0FEhxN3021953@brahms.sibelius.xs4all.nl>

On Tue, 2008-01-15 at 15:43 +0100, Mark Kettenis wrote:
> > The 64-bit PowerPC ELF ABI version 1.9 says that "single precision
> > floating point values are mapped to the second word in a single
> > doubleword". The ppc64_sysv_abi_push_dummy_call function in
> > ppc-sysv-tdep.c, however, implements version 1.7 of the ABI which says
> > that they should go in the first doubleword.
> 
> Aren't ABI changes fun?

Heh. :-)

> Is the first word used for anything in the new ABI?  If not, you could
> support both ABIs by copying the value into both the first and the
> second word.

Great idea. I will resend the patch using that approach then.

> > Because of this, if you are calling a function with many arguments and
> > some need to be passed on the stack, GDB will get it wrong for 32-bit
> > floats. This is why in Linux/ppc64 GDB fails the "Call function with
> > many float arguments" test posted here:
> > 
> > http://sourceware.org/ml/gdb-patches/2008-01/msg00291.html
> > 
> > This patch fixes the test. It makes GDB pass 32-bit floats in the second
> > word when passing them in the stack as stated in the current ABI.
> > 
> > I didn't touch the code which writes the float to a general register in
> > the first word because I'm not sure how to test it. It is probably
> > related to soft-float, I guess.
> 
> Actually, it may be related to varargs.  Or perhaps it is a leftover
> from the 32-bit ABI code that was copied.

I'll play with varargs and see if I can trigger that code and create a
test for it.

> > Tested on Linux/ppc64 with no regressions. I believe this will also fix
> > other operating systems supported by GDB on ppc64 since they use the
> > same push_dummy_call implementation (assuming they also follow the
> > current SysV ABI), but I don't have the means to test them either.
> > 
> > Maybe someone could test the patch and the testcase in *BSD? Luis' patch
> > which has the testcases would also need this testing.
> 
> There's no 64-bit OpenBSD/powerpc port; we only run on Apple hardware
> and we run the G5 machines in 32-bit mode.
> 
> It doesn't look like NetBSD and FreeBSD have a working 64-bit powerpc
> port either.

Ok, good to know that.

> I'm fairly certain Linux/ppc64 used the old ABI for a while.  Are you
> certain GDB doesn't need to support any people running those older
> installs anymore?

No, I'm not actually...
Writing in both words should resolve this.
-- 
[]'s
Thiago Jung Bauermann
Software Engineer
IBM Linux Technology Center


  parent reply	other threads:[~2008-01-15 17:40 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-01-15 12:34 Thiago Jung Bauermann
2008-01-15 14:44 ` Mark Kettenis
2008-01-15 17:23   ` Jim Blandy
2008-01-15 17:40   ` Thiago Jung Bauermann [this message]
2008-01-15 20:34     ` Thiago Jung Bauermann
2008-01-15 20:48       ` Mark Kettenis
2008-01-15 20:55         ` Thiago Jung Bauermann
2008-01-16 12:49           ` Thiago Jung Bauermann
2008-01-16 14:45             ` Luis Machado
2008-01-25 15:58             ` Thiago Jung Bauermann
2008-01-25 16:06               ` Thiago Jung Bauermann
2008-01-31 22:12               ` Daniel Jacobowitz
2008-02-01 15:19                 ` Thiago Jung Bauermann

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=1200418789.3158.71.camel@localhost.localdomain \
    --to=bauerman@br.ibm.com \
    --cc=gdb-patches@sourceware.org \
    --cc=mark.kettenis@xs4all.nl \
    /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