From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 77301 invoked by alias); 30 May 2019 03:52:46 -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 77292 invoked by uid 89); 30 May 2019 03:52:45 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.3 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,HTML_MESSAGE,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.1 spammy=__float128, H*c:alternative X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0b-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.158.5) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Thu, 30 May 2019 03:52:44 +0000 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4U3lY5H073142 for ; Wed, 29 May 2019 23:52:42 -0400 Received: from e12.ny.us.ibm.com (e12.ny.us.ibm.com [129.33.205.202]) by mx0b-001b2d01.pphosted.com with ESMTP id 2st5h6ceva-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 29 May 2019 23:52:42 -0400 Received: from localhost by e12.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 30 May 2019 04:52:41 +0100 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e12.ny.us.ibm.com (146.89.104.199) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 30 May 2019 04:52:40 +0100 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x4U3qd0I45482018 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 30 May 2019 03:52:39 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 73862AC05B; Thu, 30 May 2019 03:52:39 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0F647AC059; Thu, 30 May 2019 03:52:39 +0000 (GMT) Received: from BigMac.local (unknown [9.85.143.85]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Thu, 30 May 2019 03:52:38 +0000 (GMT) To: GCC Patches Cc: Segher Boessenkool From: Bill Schmidt Subject: [PATCH] rs6000: Add target supports for "future" system Date: Thu, 30 May 2019 03:55:00 -0000 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.14; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 MIME-Version: 1.0 x-cbid: 19053003-0060-0000-0000-00000349BDFB X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011182; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000286; SDB=6.01210563; UDB=6.00636024; IPR=6.00991597; MB=3.00027111; MTD=3.00000008; XFM=3.00000015; UTC=2019-05-30 03:52:41 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19053003-0061-0000-0000-0000498CA2CB Message-Id: <13012539-5f8a-312b-715c-aa8d3fd46576@linux.ibm.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-SW-Source: 2019-05/txt/msg01985.txt.bz2 Hi, This patch from Mike Meissner adds procs to target-supports.exp to support -mcpu=future. Tested in conjunction with the next patch (test cases) with no problems. Is this okay for trunk? Thanks, Bill 2019-05-29 Michael Meissner * lib/target-supports.exp (check_powerpc_future_hw_available): New. (check_effective_target_powerpc_future_ok): New. diff --git a/gcc/testsuite/lib/target-supports.exp b/gcc/testsuite/lib/target-supports.exp index 3bd6e815715..982ec8ccc09 100644 --- a/gcc/testsuite/lib/target-supports.exp +++ b/gcc/testsuite/lib/target-supports.exp @@ -2140,6 +2140,25 @@ proc check_p9modulo_hw_available { } { }] } + +# Return 1 if the target supports executing FUTURE instructions, 0 otherwise. +# Cache the result. It is assumed that if a simulator does not support the +# FUTURE instructions, that it will generate an error and this test will fail. + +proc check_powerpc_future_hw_available { } { + return [check_cached_effective_target powerpc_future_hw_available { + check_runtime_nocache powerpc_future_hw_available { + int main() + { + /* Set e first and use +r to check if pli actually works. */ + long e = -1; + asm ("pli %0,%1" : "+r" (e) : "n" (0x12345)); + return (e == 0x12345); + } + } "-mfuture" + }] +} + # Return 1 if the target supports executing __float128 on PowerPC via software # emulation, 0 otherwise. Cache the result. @@ -5123,6 +5142,24 @@ proc check_effective_target_powerpc_p9modulo_ok { } { } } +# Return 1 if this is a PowerPC target supporting -mfuture. +# Limit this to 64-bit linux systems for now until other +# targets support FUTURE. + +proc check_effective_target_powerpc_future_ok { } { + if { ([istarget powerpc64*-*-linux*]) } { + return [check_no_compiler_messages powerpc_future_ok object { + int main (void) { + long e; + asm ("pli %0,%1" : "=r" (e) : "n" (0x12345)); + return e; + } + } "-mfuture"] + } else { + return 0 + } +} + # Return 1 if this is a PowerPC target supporting -mfloat128 via either # software emulation on power7/power8 systems or hardware support on power9.