From patchwork Thu Nov 14 22:56:50 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 1195239 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-513513-incoming=patchwork.ozlabs.org@gcc.gnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=linux.ibm.com Authentication-Results: ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=gcc.gnu.org header.i=@gcc.gnu.org header.b="SC8Lff5e"; dkim-atps=neutral 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 47DcLZ0JW4z9sP3 for ; Fri, 15 Nov 2019 09:57:07 +1100 (AEDT) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; q=dns; s=default; b=GMcTRYtcxuLaXr+TtODSHTEqEIUbkf hXIN0cDWTdL4DoshQOW2QavI6qGn9NJD663oivQtEpP6x8B/uJLvS7WeVH9jLWUv T1LQtDg8Bu5iHeq27ah39CX+Do1GP50gKUGNaVSvN36yJppPyamVF7rCgNjfLQz2 rdq3Va+GWniWU= 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:date :from:to:subject:message-id:references:mime-version:content-type :in-reply-to; s=default; bh=dCd9g2togxnzvUxS19s3y8xQGWc=; b=SC8L ff5ej/+DRRcPHdXfj3d70g0omk1MmEmwUQWJabeksA5eeaTL+/ncUGBp0jNOGGP9 BiRFAZzeyZHCULq5Ce91Ad9WLMdVEfxJ4VcWbEPjqXQFecjpkR0ix8KFi96IXPqK tYGrRBKaGV1Podszprpk8UbxhD5Y5M4Xv+nrn34= Received: (qmail 112092 invoked by alias); 14 Nov 2019 22:56:59 -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 112079 invoked by uid 89); 14 Nov 2019 22:56:59 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-11.0 required=5.0 tests=AWL, BAYES_00, GIT_PATCH_2, GIT_PATCH_3, RCVD_IN_DNSWL_LOW, SPF_PASS autolearn=ham version=3.3.1 spammy=FUTURE, sk:is-effe, sk:iseffe 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, 14 Nov 2019 22:56:57 +0000 Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id xAEMlClb142761; Thu, 14 Nov 2019 17:56:55 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 2w9fakhh72-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Nov 2019 17:56:55 -0500 Received: from m0098413.ppops.net (m0098413.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.27/8.16.0.27) with SMTP id xAEMuCE1010953; Thu, 14 Nov 2019 17:56:55 -0500 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0b-001b2d01.pphosted.com with ESMTP id 2w9fakhh6t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Nov 2019 17:56:55 -0500 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id xAEMsnVA010711; Thu, 14 Nov 2019 22:56:54 GMT Received: from b03cxnp07028.gho.boulder.ibm.com (b03cxnp07028.gho.boulder.ibm.com [9.17.130.15]) by ppma01dal.us.ibm.com with ESMTP id 2w9f8prfet-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 14 Nov 2019 22:56:54 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp07028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id xAEMurLQ41419246 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 14 Nov 2019 22:56:53 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 43B1A6A047; Thu, 14 Nov 2019 22:56:53 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C5D726A051; Thu, 14 Nov 2019 22:56:52 +0000 (GMT) Received: from ibm-toto.the-meissners.org (unknown [9.32.77.177]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTPS; Thu, 14 Nov 2019 22:56:52 +0000 (GMT) Date: Thu, 14 Nov 2019 17:56:50 -0500 From: Michael Meissner To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn Subject: [PATCH], V7, #5 of 7, Add more effective targets for the 'future' system to target-supports. Message-ID: <20191114225650.GE7528@ibm-toto.the-meissners.org> Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn References: <20191114222509.GA7581@ibm-toto.the-meissners.org> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191114222509.GA7581@ibm-toto.the-meissners.org> User-Agent: Mutt/1.5.21 (2010-09-15) This patch adds more effective targets to the target-supports.exp in the testsuite. I tried to break it down to whether prefixed instructions are allowed, whether the target is generating 64-bit code with prefixed instructions, and if -mpcrel support is available. I also enabled 'future' testing on the actual hardware (or simulator). The tests in V8 will use some of these capabilities. I have run the test suite on a little endian power8 system with no degradation. Can I check this into the FSF trunk? 2019-11-14 Michael Meissner * lib/target-supports.exp (check_effective_target_powerpc_future_ok): Do not require 64-bit or Linux support before doing the test. Use a 32-bit constant in PLI. (check_effective_target_powerpc_prefixed_addr_ok): New effective target test to see if prefixed memory instructions are supported. (check_effective_target_powerpc_pcrel_ok): New effective target test to test whether PC-relative addressing is supported. (is-effective-target): Add test for the PowerPC 'future' hardware support. Index: gcc/testsuite/lib/target-supports.exp =================================================================== --- gcc/testsuite/lib/target-supports.exp (revision 278173) +++ gcc/testsuite/lib/target-supports.exp (working copy) @@ -5345,16 +5345,14 @@ proc check_effective_target_powerpc_p9mo } } -# Return 1 if this is a PowerPC target supporting -mfuture. -# Limit this to 64-bit linux systems for now until other -# targets support FUTURE. +# Return 1 if this is a PowerPC target supporting -mcpu=future. proc check_effective_target_powerpc_future_ok { } { - if { ([istarget powerpc64*-*-linux*]) } { + if { ([istarget powerpc*-*-*]) } { return [check_no_compiler_messages powerpc_future_ok object { int main (void) { long e; - asm ("pli %0,%1" : "=r" (e) : "n" (0x12345)); + asm ("pli %0,%1" : "=r" (e) : "n" (0x1234)); return e; } } "-mfuture"] @@ -5363,6 +5361,46 @@ proc check_effective_target_powerpc_futu } } +# Return 1 if this is a PowerPC target supporting -mcpu=future. The compiler +# must support large numeric prefixed addresses by default when -mfuture is +# used. We test loading up a large constant to verify that the full 34-bit +# offset for prefixed instructions is supported and we check for a prefixed +# load as well. + +proc check_effective_target_powerpc_prefixed_addr_ok { } { + if { ([istarget powerpc*-*-*]) } { + return [check_no_compiler_messages powerpc_prefixed_addr_ok object { + int main (void) { + extern long l[]; + long e, e2; + asm ("pli %0,%1" : "=r" (e) : "n" (0x12345678)); + asm ("pld %0,0x12345678(%1)" : "=r" (e2) : "r" (& l[0])); + return e - e2; + } + } "-mfuture"] + } else { + return 0 + } +} + +# Return 1 if this is a PowerPC target supporting -mfuture. The compiler must +# support PC-relative addressing when -mcpu=future is used to pass this test. + +proc check_effective_target_powerpc_pcrel_ok { } { + if { ([istarget powerpc*-*-*]) } { + return [check_no_compiler_messages powerpc_pcrel_ok object { + int main (void) { + static int s __attribute__((__used__)); + int e; + asm ("plwa %0,s@pcrel(0),1" : "=r" (e)); + 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. @@ -7261,6 +7299,7 @@ proc is-effective-target { arg } { "named_sections" { set selected [check_named_sections_available] } "gc_sections" { set selected [check_gc_sections_available] } "cxa_atexit" { set selected [check_cxa_atexit_available] } + "powerpc_future_hw" { set selected [check_powerpc_future_hw_available] } default { error "unknown effective target keyword `$arg'" } } }