Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: "Ulrich Weigand" <uweigand@de.ibm.com>
To: drow@false.org (Daniel Jacobowitz)
Cc: gdb-patches@sourceware.org
Subject: Re: [rfc] PowerPC ABI detection and overrides
Date: Mon, 29 Oct 2007 18:27:00 -0000	[thread overview]
Message-ID: <200710291811.l9TIBRpc017629@d12av02.megacenter.de.ibm.com> (raw)
In-Reply-To: <20071025195932.GA4791@caradoc.them.org> from "Daniel Jacobowitz" at Oct 25, 2007 03:59:32 PM

Daniel Jacobowitz wrote:

> Run the test four times:
> 
> - With -mabi=no-altivec and "set powerpc vector-abi generic".
> - With -mabi=altivec and "set powerpc vector-abi altivec".
> - With no ABI option and "set powerpc vector-abi auto".
> - With -mabi=altivec and "set powerpc vector-abi auto".
> 
> I think this covers all the sensible combinations.

This looks excellent!  

> You will need
> a relatively current GCC and very current linker for the auto tests
> to all pass.

Any chance of making those tests XFAIL instead of FAIL if the
toolchain is too old?

> Unfortunately the -mabi=no-altivec tests fail.  I filed GCC PR
> 33899 about this.  In the current scenario there is no way we
> can get this right.  I'm not going to commit this until I've at least
> discussed that with David.

Hmmm, yet another problem I wasn't aware of ...

However, this may not be quite as bad as it seems:  note that while
in your bugzilla report, you're refering to use of "__vector int",
this actually doesn't work:  the "AltiVec vector" types introduced
via the __vector or vector keywords are only available in the first
place if you use -maltivec; otherwise that code is rejected with a
syntax error anyway.

The third vector return ABI only comes into play if you explicitly
use the GCC-internal vector type via attribute ((vector_size (16))),
and do not use -maltivec.  In this situation, GCC will currently
indeed return vector values by reference, but the code will trigger
a compiler warning:
xxx.c:5: warning: GCC vector returned by reference: non-standard ABI extension with no compatibility guarantee

I do not think that under these circumstances there can be any 
reasonable expectation for GDB to handle that situation.

So I would suggest that GDB interprets the "generic" case always
as the "-maltivec -mabi=no-altivec" situation, and expects 16-byte
vector return values in general-purpose registers.  This would also
fix our test cases (as those use the Altivec vector syntax and thus
reqiure -maltivec anyway).


> @@ -3027,6 +3049,9 @@ rs6000_gdbarch_init (struct gdbarch_info

> +#ifdef HAVE_ELF
> +  if (soft_float_flag == AUTO_BOOLEAN_AUTO && from_elf_exec)
> +    {
> +      switch (bfd_elf_get_obj_attr_int (info.abfd, OBJ_ATTR_GNU,
> +					Tag_GNU_Power_ABI_FP))

Hmmm, I would have hoped we could get away from directly refering
to the BFD in the gdbarch_init routine ...   It would be nicer to
more strictly distinguish between detecting ABI properties from
the BFD (in the *sniffer*), and installing an gdbarch handler 
supporting a particular set of ABI properties (in the gdbarch_init
routine).

This would allow to request a specific gdbarch in the situation
where you know exactly which ABI properties you need, but don't
have any BFD handy ...


(This doesn't mean I don't want this patch to go in -- I'm aware
that we're current looking at the BFD anyway.  I'm just wondering
if you have any ideas how this could be improved ...)

Bye,
Ulrich

-- 
  Dr. Ulrich Weigand
  GNU Toolchain for Linux on System z and Cell BE
  Ulrich.Weigand@de.ibm.com


  reply	other threads:[~2007-10-29 18:11 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-21 13:05 [commit] Use -mabi=altivec for AltiVec tests Ulrich Weigand
2007-10-21 18:08 ` Daniel Jacobowitz
2007-10-21 19:37   ` Ulrich Weigand
2007-10-24 20:47     ` Daniel Jacobowitz
2007-10-29 18:04       ` Ulrich Weigand
2007-10-29 18:06         ` Daniel Jacobowitz
2007-10-29 18:32           ` Ulrich Weigand
2007-10-25 20:32     ` [rfc] PowerPC ABI detection and overrides Daniel Jacobowitz
2007-10-29 18:27       ` Ulrich Weigand [this message]
2007-10-29 18:38         ` Daniel Jacobowitz
2007-10-29 19:02           ` Ulrich Weigand
2007-10-29 19:16             ` Daniel Jacobowitz
2007-10-29 19:27               ` Ulrich Weigand
2007-10-30 20:12       ` Daniel Jacobowitz
2007-10-30 21:12         ` Ulrich Weigand

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=200710291811.l9TIBRpc017629@d12av02.megacenter.de.ibm.com \
    --to=uweigand@de.ibm.com \
    --cc=drow@false.org \
    --cc=gdb-patches@sourceware.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox