Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Kevin Buettner <kevinb@redhat.com>
To: Jerome Guitton <guitton@act-europe.fr>
Cc: gdb-patches@sources.redhat.com
Subject: Re: [RFA] powerpc - extract a float return value
Date: Wed, 21 Apr 2004 17:54:00 -0000	[thread overview]
Message-ID: <20040421105415.12577df1@saguaro> (raw)
In-Reply-To: <20040420180348.GA23715@act-europe.fr>

On Tue, 20 Apr 2004 20:03:48 +0200
Jerome Guitton <guitton@act-europe.fr> wrote:

> The way GDB extracts float return values in rs6000-tdep.c
> (rs6000_extract_return_value) seems dubious to me:
> 
> [...]
> memcpy (&dd, &regbuf[DEPRECATED_REGISTER_BYTE (FP0_REGNUM + 1)], 8);
> ff = (float) dd;
> memcpy (valbuf, &ff, sizeof (float));
> [...]
> 
> The cast will not work properly if the target and the host have not a similar
> float representation.

I agree.

> I propose to fix that by a call to convert_typed_floating. See patch in
> attachment.

This looks right to me.

The rs6000 return value code will need to be revamped to not refer to
DEPRECATED_REGISTER_BYTE.  And, in fact, it probably ought to be
restructured to use the mechanisms found in ppc-linux.c.  See
ppc_linux_return_value() and ppc_sysv_abi_return_value().  This
is not a barrier to getting your current patch in; I only mention
it in case you wish to tackle this bit of work too.

> I have not yet tested it against the testsuite, I will do that
> tomorrow. In the meantime, if you have comments I would be happy to
> address them!

Please let me know the results of your tests.  If they look good,
please commit your patch.

Thanks!

Kevin


  reply	other threads:[~2004-04-21 17:54 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-04-20 18:03 Jerome Guitton
2004-04-21 17:54 ` Kevin Buettner [this message]
2004-04-21 19:40   ` Andrew Cagney
2004-04-23 14:38   ` Jerome Guitton
2004-04-23 16:03     ` Kevin Buettner
2004-04-23 16:23       ` Jerome Guitton
2004-04-24  0:03     ` Andrew Cagney
2004-04-23 16:39       ` Jerome Guitton
2004-04-23 19:14         ` Joel Brobecker
2004-04-24  0:03         ` Andrew Cagney

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=20040421105415.12577df1@saguaro \
    --to=kevinb@redhat.com \
    --cc=gdb-patches@sources.redhat.com \
    --cc=guitton@act-europe.fr \
    /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