Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Luis Machado <lgustavo@codesourcery.com>
To: Mark Kettenis <mark.kettenis@xs4all.nl>
Cc: <gdb-patches@sourceware.org>
Subject: Re: [PATCH] Fix passing/returning of complex data for PowerPC 32-bit
Date: Mon, 07 Jul 2014 08:14:00 -0000	[thread overview]
Message-ID: <53BA56E2.6020402@codesourcery.com> (raw)
In-Reply-To: <53ADBAA5.9090404@codesourcery.com>

On 06/27/2014 07:40 PM, Luis Machado wrote:
> On 06/27/2014 11:30 AM, Mark Kettenis wrote:
>>> Date: Thu, 26 Jun 2014 06:54:59 +0100
>>> From: Luis Machado <lgustavo@codesourcery.com>
>>>
>>> The PowerPC 32-bit unified ABI states that there are two ways of passing
>>> and returning complex type data:
>>>
>>> - Pointer, in a register, to a memory area.
>>> - Data in registers.
>>>
>>> The problem is that it is not clear how to detect which variation a
>>> program is using. GDB currently does a bit of both. It uses the first
>>> mechanism for passing parameters and uses both to return data, depending
>>> on the size of the data type. It is a bit messy because GDB is not
>>> handling complex types explicitly.
>>>
>>> Checking the gdb.base/callfuncs.exp testcase for a PowerPC 32-bit
>>> target, with code built with GCC, showed a few failures related to
>>> complex types.
>>>
>>> This patch steers GDB towards what GCC seems to generate for PowerPC
>>> 32-bit and handles complex type passing/return via general registers
>>> (the second option). All failures are gone.
>>>
>>> The problem here is if some other target/compiler is using the other
>>> variation. So, for those that have a PowerPC 32-bit handy, can you
>>> confirm it works reliably? I'm thinking AIX, Darwin or some other eabi
>>> target.
>>
>> AIX uses its own inplementations (rs6000_push_dummy_call and
>> rs6000_return_value).  And we don't support Darwin on PowerPC.
>>
>
> True. That should be a non issue then.
>
>>> Otherwise, does this look reasonable?
>>
>> I agree that the "System V" support code should support the
>> ATR-PASS-COMPLEX-IN-GPRS ABI Attribute.  This is what the Linux ABI
>> uses (it is included in ATR-LINUX) which pretty much is the direct
>> succssor of the System V ABI (which didn't specify anything about
>> complex floating-point support).
>>
>> If somebody really wants to support complex numbers on an embedded
>> system that uses ATR-PASS-COMPLEX-AS-STRUCT, they'll have to implement
>> an osabi sniffer for it and override the appropriate methods.
>>
>> Code generally looks good.  Some nits below.  The comments are a bit
>> elaborate though.  I'd cut them down a bit; see my suggestion below.
>>
>>
>
> I adjusted the patch and compressed the comments according to the
> suggestions.
>
> Thanks!
> Luis

It seems folks are happy with this patch (at least the interested 
parties), so i'll go ahead and commit this one in the following days 
unless i hear something back.

Thanks,
Luis


      reply	other threads:[~2014-07-07  8:14 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-06-26  5:55 Luis Machado
2014-06-26  9:32 ` Mark Kettenis
2014-06-26 10:02   ` Mark Kettenis
2014-06-27  8:01     ` Luis Machado
2014-06-27 10:30 ` Mark Kettenis
2014-06-27 18:40   ` Luis Machado
2014-07-07  8:14     ` Luis Machado [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=53BA56E2.6020402@codesourcery.com \
    --to=lgustavo@codesourcery.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