From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 89889 invoked by alias); 6 Oct 2015 16:38:10 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 89876 invoked by uid 89); 6 Oct 2015 16:38:10 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.9 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 X-HELO: relay1.mentorg.com Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Tue, 06 Oct 2015 16:38:09 +0000 Received: from svr-orw-fem-05.mgc.mentorg.com ([147.34.97.43]) by relay1.mentorg.com with esmtp id 1ZjVFe-000335-2k from James_Norris@mentor.com for gcc-patches@gcc.gnu.org; Tue, 06 Oct 2015 09:38:06 -0700 Received: from [172.30.80.10] (147.34.91.1) by svr-orw-fem-05.mgc.mentorg.com (147.34.97.43) with Microsoft SMTP Server id 14.3.224.2; Tue, 6 Oct 2015 09:38:05 -0700 Message-ID: <5613F8EC.4000400@codesourcery.com> Date: Tue, 06 Oct 2015 16:38:00 -0000 From: James Norris User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Subject: [gomp4] Add -foffload-abi support for PPC Content-Type: multipart/mixed; boundary="------------060702080604090507090303" X-SW-Source: 2015-10/txt/msg00600.txt.bz2 --------------060702080604090507090303 Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit Content-length: 191 Hi, The attached patch adds the -foffload-abi option support for PPC. Only support for the 64-bit ABI has been added. Committed after regtesting with x86_64 and powerpc64le. Thanks! Jim --------------060702080604090507090303 Content-Type: text/x-patch; name="offload.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="offload.patch" Content-length: 3755 diff --git a/gcc/ChangeLog.gomp b/gcc/ChangeLog.gomp index a65e652..40326cf 100644 --- a/gcc/ChangeLog.gomp +++ b/gcc/ChangeLog.gomp @@ -1,3 +1,11 @@ +2015-10-06 James Norris + + * common.opt (OFFLOAD_ABI_PPC64): New enum. + * config/nvptx/mkoffload.c (compile_native): Handle new enum. + (main): Handle new option. + * config/rs6000/rs6000.c (rs6000_offload_options): New hook. + * gcc/coretypes.h (OFFLOAD_ABI_PPC64): New enum. + 2015-10-05 Thomas Schwinge * config/nvptx/mkoffload.c (main): Don't explicitly pass "-lgomp" diff --git a/gcc/common.opt b/gcc/common.opt index 290b6b3..c366667 100644 --- a/gcc/common.opt +++ b/gcc/common.opt @@ -1730,6 +1730,9 @@ Enum(offload_abi) String(ilp32) Value(OFFLOAD_ABI_ILP32) EnumValue Enum(offload_abi) String(lp64) Value(OFFLOAD_ABI_LP64) +EnumValue +Enum(offload_abi) String(ppc64) Value(OFFLOAD_ABI_PPC64) + fomit-frame-pointer Common Report Var(flag_omit_frame_pointer) Optimization When possible do not generate stack frames diff --git a/gcc/config/nvptx/mkoffload.c b/gcc/config/nvptx/mkoffload.c index e398b44..743df4b 100644 --- a/gcc/config/nvptx/mkoffload.c +++ b/gcc/config/nvptx/mkoffload.c @@ -367,6 +367,8 @@ compile_native (const char *infile, const char *outfile, const char *compiler) case OFFLOAD_ABI_ILP32: obstack_ptr_grow (&argv_obstack, "-m32"); break; + case OFFLOAD_ABI_PPC64: + break; default: gcc_unreachable (); } @@ -458,6 +460,8 @@ main (int argc, char **argv) offload_abi = OFFLOAD_ABI_LP64; else if (strcmp (argv[i] + strlen (STR), "ilp32") == 0) offload_abi = OFFLOAD_ABI_ILP32; + else if (strcmp (argv[i] + strlen (STR), "ppc64") == 0) + offload_abi = OFFLOAD_ABI_PPC64; else fatal_error (input_location, "unrecognizable argument of option " STR); @@ -485,6 +489,8 @@ main (int argc, char **argv) case OFFLOAD_ABI_ILP32: obstack_ptr_grow (&argv_obstack, "-m32"); break; + case OFFLOAD_ABI_PPC64: + break; default: gcc_unreachable (); } @@ -518,7 +524,8 @@ main (int argc, char **argv) /* PR libgomp/65099: Currently, we only support offloading in 64-bit configurations, and only for OpenACC offloading. */ - if (offload_abi == OFFLOAD_ABI_LP64 && fopenacc) + if ((offload_abi == OFFLOAD_ABI_LP64 + || (offload_abi == OFFLOAD_ABI_PPC64)) && fopenacc) { ptx_name = make_temp_file (".mkoffload"); obstack_ptr_grow (&argv_obstack, "-o"); diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 023f622..146b45b 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1688,6 +1688,9 @@ static const struct attribute_spec rs6000_attribute_table[] = #define TARGET_LIBGCC_SHIFT_COUNT_MODE rs6000_abi_word_mode #undef TARGET_UNWIND_WORD_MODE #define TARGET_UNWIND_WORD_MODE rs6000_abi_word_mode + +#undef TARGET_OFFLOAD_OPTIONS +#define TARGET_OFFLOAD_OPTIONS rs6000_offload_options /* Processor table. */ @@ -9532,6 +9535,13 @@ rs6000_abi_word_mode (void) return TARGET_32BIT ? SImode : DImode; } +/* Implement the TARGET_OFFLOAD_OPTIONS hook. */ +static char * +rs6000_offload_options (void) +{ + return xstrdup ("-foffload-abi=ppc64"); +} + /* On rs6000, function arguments are promoted, as are function return values. */ diff --git a/gcc/coretypes.h b/gcc/coretypes.h index 7b3df54..3bb0528 100644 --- a/gcc/coretypes.h +++ b/gcc/coretypes.h @@ -170,7 +170,8 @@ enum tls_model { enum offload_abi { OFFLOAD_ABI_UNSET, OFFLOAD_ABI_LP64, - OFFLOAD_ABI_ILP32 + OFFLOAD_ABI_ILP32, + OFFLOAD_ABI_PPC64 }; /* Types of unwind/exception handling info that can be generated. */ --------------060702080604090507090303--