From patchwork Fri Oct 9 12:20:49 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Norris X-Patchwork-Id: 528198 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 6D4C11406AA for ; Fri, 9 Oct 2015 23:21:05 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b=IAuIyfZB; dkim-atps=neutral DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; q=dns; s=default; b=b9VypFHhCnpt33QWg mDBtd15JimC9oGIzUPGhwJgvLTgnJuVHBlCm805bva9xyH/qME50M6g/EWSB6kWu eZ0PRK6v5OnLF2u02Deke6aA38quuUxLmBULUtcI9q7X1DMM0BqizAgxxI8GYhj+ agYixC+TXjrtMbpGp9YkCzMFUU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender :message-id:date:from:mime-version:to:cc:subject:references :in-reply-to:content-type; s=default; bh=Qbo8ETfjL90pLqLGX7h2JcT wRQ8=; b=IAuIyfZBBIocjtODk1d3QOfhhP6XJHmRNYWIR3EqrXBfh3tD7d8zIJ7 fROVlm4Kdpvp/KnvOlrXxgCTgnOIu9ftZ06J1lBmRJ6mwFq+Es8WfUyvcrZmW4Wz GIMGcjAKa2InZZINQZ1X1Br+sg19uhH2UlNGwsIff7dSgYTyLYKM= Received: (qmail 115139 invoked by alias); 9 Oct 2015 12:20:58 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org Received: (qmail 115068 invoked by uid 89); 9 Oct 2015 12:20:57 -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; Fri, 09 Oct 2015 12:20:54 +0000 Received: from svr-orw-fem-05.mgc.mentorg.com ([147.34.97.43]) by relay1.mentorg.com with esmtp id 1ZkWfL-00055X-5e from James_Norris@mentor.com ; Fri, 09 Oct 2015 05:20:51 -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; Fri, 9 Oct 2015 05:20:50 -0700 Message-ID: <5617B121.7000500@codesourcery.com> Date: Fri, 9 Oct 2015 07:20:49 -0500 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: David Edelsohn CC: Thomas Schwinge , GCC Patches Subject: Re: Add -foffload-abi support for PPC References: <87zizxcxnm.fsf@schwinge.name> <5613F8EC.4000400@codesourcery.com> <87bncbp0mi.fsf@kepler.schwinge.homeip.net> <56169779.5040903@codesourcery.com> In-Reply-To: X-TagToolbar-Keys: D20151009072049594 David, On 10/08/2015 11:53 AM, David Edelsohn wrote: > On Thu, Oct 8, 2015 at 12:19 PM, James Norris wrote: > >> I've revised the patch from the review comments (thank you) and >> is attached. >> >> Regtested on x86_64 and powerpcle64. >> >> OK for trunk? > > What is the goal? Do you want this to return the correct value or only > the value for the supported 64 bit PPC64LE system? > > Thanks, David > > The goal is to support both 32-bit and 64-bit. There was some confusion on my part, my apologies. Attached is the corrected patch. Thanks! Jim diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index e095f03..8aac4f7 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -1690,6 +1690,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. */ @@ -9530,6 +9533,16 @@ rs6000_abi_word_mode (void) return TARGET_32BIT ? SImode : DImode; } +/* Implement the TARGET_OFFLOAD_OPTIONS hook. */ +static char * +rs6000_offload_options (void) +{ + if (TARGET_64BIT) + return xstrdup ("-foffload-abi=lp64"); + else + return xstrdup ("-foffload-abi=ilp32"); +} + /* On rs6000, function arguments are promoted, as are function return values. */