From: Thomas Schwinge <thomas@codesourcery.com>
To: James Norris <jnorris@codesourcery.com>,
David Edelsohn <dje.gcc@gmail.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: Add -foffload-abi support for PPC
Date: Thu, 08 Oct 2015 16:55:00 -0000 [thread overview]
Message-ID: <87oag9cnbe.fsf@schwinge.name> (raw)
In-Reply-To: <56169779.5040903@codesourcery.com>
[-- Attachment #1: Type: text/plain, Size: 2063 bytes --]
Hi!
On Thu, 8 Oct 2015 11:19:05 -0500, James Norris <jnorris@codesourcery.com> wrote:
> On 10/07/2015 08:51 AM, David Edelsohn wrote:
> > On Wed, Oct 7, 2015 at 4:02 AM, Thomas Schwinge <thomas@codesourcery.com> wrote:
> >
> >> From a quick look at the *_TYPE_SIZE definitions in
> >> gcc/config/rs6000/rs6000.h as well as
> >> <http://refspecs.linuxfoundation.org/elf/elfspec_ppc.pdf>, "3-1
> >> Fundamental Types", and
> >> <http://refspecs.linuxfoundation.org/ELF/ppc64/PPC-elf64abi.html#FUND-TYPE>,
> >> I gather we're dealing with regular ilp32/lp64 here. Then, I assume the
> >> right thing is to use the 64BIT flag from gcc/config/rs6000/sysv4.opt
> >> (which, per gcc/config.gcc I suppose is used for the relevant
> >> powerpc64le-linux-gnu configuration). (David?)
> >
> > TARGET_64BIT is the appropriate macro to test.
> >
> >>
> >> I'm not sure where to place the TARGET_OFFLOAD_OPTIONS #define and the
> >> function definition in rs6000.c. (David?)
> >
> > As mentioned earlier, only PPC64LE is supported.
> >
> > I'm not sure if it really matters if this is defined in ELF-specific
> > portion of the file or a general place, although it never will be
> > called by other configurations.
> >
> > Thanks, David
> >
>
> I've revised the patch from the review comments (thank you) and
> is attached.
>
> Regtested on x86_64 and powerpcle64.
>
> OK for trunk?
> --- a/gcc/config/rs6000/rs6000.c
> +++ b/gcc/config/rs6000/rs6000.c
> +/* Implement the TARGET_OFFLOAD_OPTIONS hook. */
> +static char *
> +rs6000_offload_options (void)
> +{
> + return xstrdup ("-foffload-abi=lp64");
> +}
Well, that's a stripped-down variant of what I had suggested:
static char *
rs6000_offload_options (void)
{
if (TARGET_64BIT)
return xstrdup ("-foffload-abi=lp64");
else
return xstrdup ("-foffload-abi=ilp32");
}
If you return -foffload-abi=lp64 unconditionally, strange things will
happen for -m32 compilation (ABI mismatch).
Grüße,
Thomas
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 472 bytes --]
prev parent reply other threads:[~2015-10-08 16:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <87zizxcxnm.fsf@schwinge.name>
2015-10-06 16:38 ` [gomp4] " James Norris
2015-10-07 8:02 ` Thomas Schwinge
2015-10-07 13:51 ` David Edelsohn
2015-10-08 16:19 ` James Norris
2015-10-08 16:53 ` David Edelsohn
2015-10-09 12:20 ` James Norris
2015-10-09 12:22 ` David Edelsohn
2015-10-08 16:55 ` Thomas Schwinge [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=87oag9cnbe.fsf@schwinge.name \
--to=thomas@codesourcery.com \
--cc=dje.gcc@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jnorris@codesourcery.com \
/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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).