From patchwork Wed May 29 12:42:38 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bill Schmidt X-Patchwork-Id: 1107136 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=gcc.gnu.org (client-ip=209.132.180.131; helo=sourceware.org; envelope-from=gcc-patches-return-501841-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="GpvUM6l8"; 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 45DVjq4bf5z9s7h for ; Wed, 29 May 2019 22:42:55 +1000 (AEST) DomainKey-Signature: a=rsa-sha1; c=nofws; d=gcc.gnu.org; h=list-id :list-unsubscribe:list-archive:list-post:list-help:sender:to:cc :from:subject:date:mime-version:message-id:content-type :content-transfer-encoding; q=dns; s=default; b=Dcwpdf1PM4vzrDIu oW3cHOi8qARrAflCMdywW0TPTh688TOZssRyBft2tRTXCqKe4sTHvzl8dA+LzFqb ge05lQa+98nG8WiWv0EZkfeo+1W4yy8CzIddQd3w9umvbd6umKgB17zqKPYcFCmd sOUWQbXLGJPmSCB+xiwZevf/Ms0= 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:to:cc :from:subject:date:mime-version:message-id:content-type :content-transfer-encoding; s=default; bh=7vuIf1cvucvmuh9xIBQ8Ww bOP/Q=; b=GpvUM6l8OkhP6beIMNgw5NFbBA1fdK/qmBLbrVWNVXtqC1C7RUtxsV Hpkvbcd0Kn5jw9fS8O0nQIkfLIJ+8aD2WaDrUetK3yvzncYLnho/8jF6867+bkY3 uxzVOjyMaUTPLjjIUmlvraS8/gz5w7gwLCv3eUazkTxPSCC69ecYc= Received: (qmail 97529 invoked by alias); 29 May 2019 12:42:48 -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 97521 invoked by uid 89); 29 May 2019 12:42:48 -0000 Authentication-Results: sourceware.org; auth=none X-Spam-SWARE-Status: No, score=-22.1 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=H*m:linux, H*c:alternative X-HELO: mx0a-001b2d01.pphosted.com Received: from mx0a-001b2d01.pphosted.com (HELO mx0a-001b2d01.pphosted.com) (148.163.156.1) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Wed, 29 May 2019 12:42:46 +0000 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x4TCc1XX135724 for ; Wed, 29 May 2019 08:42:44 -0400 Received: from e16.ny.us.ibm.com (e16.ny.us.ibm.com [129.33.205.206]) by mx0a-001b2d01.pphosted.com with ESMTP id 2sst6grce4-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 29 May 2019 08:42:43 -0400 Received: from localhost by e16.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 29 May 2019 13:42:42 +0100 Received: from b01cxnp22035.gho.pok.ibm.com (9.57.198.25) by e16.ny.us.ibm.com (146.89.104.203) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 29 May 2019 13:42: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 x4TCgdGj37552272 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 29 May 2019 12:42:39 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 60F40AC05F; Wed, 29 May 2019 12:42:39 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0787BAC059; Wed, 29 May 2019 12:42:39 +0000 (GMT) Received: from BigMac.local (unknown [9.85.143.85]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Wed, 29 May 2019 12:42:38 +0000 (GMT) To: GCC Patches Cc: Segher Boessenkool From: Bill Schmidt Subject: [PATCH] rs6000: Add undocumented switch -mprefixed-addr Date: Wed, 29 May 2019 07:42:38 -0500 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: 19052912-0072-0000-0000-00000434AFA3 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00011179; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000286; SDB=6.01210264; UDB=6.00635842; IPR=6.00991296; MB=3.00027101; MTD=3.00000008; XFM=3.00000015; UTC=2019-05-29 12:42:41 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19052912-0073-0000-0000-00004C6818C4 Message-Id: <78d1bd8d-bdaf-bb90-4e71-b8e3b9746cdf@linux.ibm.com> Hi, This patch adds the undocumented switch -mprefixed-addr and a little of the basic infrastructure around it. It also includes a couple of lines in the same code regions to disable P8 fusion for -mcpu=future. Bootstrapped and tested on powerpc64le-unknown-linux-gnu with no regressions. Is this okay for trunk? Thanks, Bill 2019-05-28 Bill Schmidt Michael Meissner * rs6000-cpus.def (OTHER_FUSION_MASKS): New #define. (ISA_FUTURE_MASKS_SERVER): Add OPTION_MASK_PREFIXED_ADDR. Mask off OTHER_FUSION_MASKS. (OTHER_FUTURE_MASKS): Add OPTION_MASK_PREFIXED_ADDR. (POWERPC_MASKS): Likewise. * rs6000.c (rs6000_option_override_internal): Error if -mprefixed-addr is specified without -mcpu=future. Error if -mpcrel is specified without -mprefixed-addr. (rs6000_opt_masks): Add entry for prefixed-addr. * rs6000.opt (mprefixed-addr): New option. diff --git a/gcc/config/rs6000/rs6000-cpus.def b/gcc/config/rs6000/rs6000-cpus.def index 5337382bdcf..2fb612a8401 100644 --- a/gcc/config/rs6000/rs6000-cpus.def +++ b/gcc/config/rs6000/rs6000-cpus.def @@ -72,13 +72,20 @@ | OPTION_MASK_P9_VECTOR \ | OPTION_MASK_DIRECT_MOVE) +/* ISA masks setting fusion options. */ +#define OTHER_FUSION_MASKS (OPTION_MASK_P8_FUSION \ + | OPTION_MASK_P8_FUSION_SIGN) + /* Support for a future processor's features. */ -#define ISA_FUTURE_MASKS_SERVER (ISA_3_0_MASKS_SERVER \ - | OPTION_MASK_FUTURE \ - | OPTION_MASK_PCREL) +#define ISA_FUTURE_MASKS_SERVER ((ISA_3_0_MASKS_SERVER \ + | OPTION_MASK_FUTURE \ + | OPTION_MASK_PCREL \ + | OPTION_MASK_PREFIXED_ADDR) \ + & ~OTHER_FUSION_MASKS) /* Flags that need to be turned off if -mno-future. */ -#define OTHER_FUTURE_MASKS (OPTION_MASK_PCREL) +#define OTHER_FUTURE_MASKS (OPTION_MASK_PCREL \ + | OPTION_MASK_PREFIXED_ADDR) /* Flags that need to be turned off if -mno-power9-vector. */ #define OTHER_P9_VECTOR_MASKS (OPTION_MASK_FLOAT128_HW \ @@ -139,6 +146,7 @@ | OPTION_MASK_POWERPC64 \ | OPTION_MASK_PPC_GFXOPT \ | OPTION_MASK_PPC_GPOPT \ + | OPTION_MASK_PREFIXED_ADDR \ | OPTION_MASK_QUAD_MEMORY \ | OPTION_MASK_QUAD_MEMORY_ATOMIC \ | OPTION_MASK_RECIP_PRECISION \ diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 9229bad6acc..1860b344c3a 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -4296,12 +4296,24 @@ rs6000_option_override_internal (bool global_init_p) rs6000_isa_flags &= ~OPTION_MASK_FLOAT128_HW; } - /* -mpcrel requires the prefixed load/store support on FUTURE systems. */ - if (!TARGET_FUTURE && TARGET_PCREL) + /* -mprefixed-addr and -mpcrel require the prefixed load/store support on + FUTURE systems. */ + if (!TARGET_FUTURE && (TARGET_PCREL || TARGET_PREFIXED_ADDR)) { if ((rs6000_isa_flags_explicit & OPTION_MASK_PCREL) != 0) error ("%qs requires %qs", "-mpcrel", "-mcpu=future"); + else if ((rs6000_isa_flags_explicit & OPTION_MASK_PREFIXED_ADDR) != 0) + error ("%qs requires %qs", "-mprefixed-addr", "-mcpu=future"); + + rs6000_isa_flags &= ~(OPTION_MASK_PCREL | OPTION_MASK_PREFIXED_ADDR); + } + + if (TARGET_PCREL && !TARGET_PREFIXED_ADDR) + { + if ((rs6000_isa_flags_explicit & OPTION_MASK_PCREL) != 0) + error ("%qs requires %qs", "-mpcrel", "-mprefixed-addr"); + rs6000_isa_flags &= ~OPTION_MASK_PCREL; } @@ -36379,6 +36391,7 @@ static struct rs6000_opt_mask const rs6000_opt_masks[] = { "power9-vector", OPTION_MASK_P9_VECTOR, false, true }, { "powerpc-gfxopt", OPTION_MASK_PPC_GFXOPT, false, true }, { "powerpc-gpopt", OPTION_MASK_PPC_GPOPT, false, true }, + { "prefixed-addr", OPTION_MASK_PREFIXED_ADDR, false, true }, { "quad-memory", OPTION_MASK_QUAD_MEMORY, false, true }, { "quad-memory-atomic", OPTION_MASK_QUAD_MEMORY_ATOMIC, false, true }, { "recip-precision", OPTION_MASK_RECIP_PRECISION, false, true }, diff --git a/gcc/config/rs6000/rs6000.opt b/gcc/config/rs6000/rs6000.opt index 43b04834746..3a4353674b8 100644 --- a/gcc/config/rs6000/rs6000.opt +++ b/gcc/config/rs6000/rs6000.opt @@ -574,6 +574,10 @@ mfuture Target Report Mask(FUTURE) Var(rs6000_isa_flags) Use instructions for a future architecture. +mprefixed-addr +Target Undocumented Mask(PREFIXED_ADDR) Var(rs6000_isa_flags) +Generate (do not generate) prefixed memory instructions. + mpcrel Target Report Mask(PCREL) Var(rs6000_isa_flags) Generate (do not generate) pc-relative memory addressing.