From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 0CF0A385BF83 for ; Mon, 6 Apr 2020 22:21:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 0CF0A385BF83 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 036M3BPQ066810; Mon, 6 Apr 2020 18:21:40 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3082hwv87v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Apr 2020 18:21:40 -0400 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 036M3JQB067491; Mon, 6 Apr 2020 18:21:39 -0400 Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com with ESMTP id 3082hwv87p-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Apr 2020 18:21:39 -0400 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 036MFaid019406; Mon, 6 Apr 2020 22:21:38 GMT Received: from b03cxnp08026.gho.boulder.ibm.com (b03cxnp08026.gho.boulder.ibm.com [9.17.130.18]) by ppma01dal.us.ibm.com with ESMTP id 306hv68bsu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Apr 2020 22:21:38 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08026.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 036MLbxW41091394 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Apr 2020 22:21:37 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6993E6A057; Mon, 6 Apr 2020 22:21:37 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0310C6A047; Mon, 6 Apr 2020 22:21:35 +0000 (GMT) Received: from lexx (unknown [9.160.32.250]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTP; Mon, 6 Apr 2020 22:21:35 +0000 (GMT) Message-ID: Subject: Re: [PATCH, V4] PowerPC Turn on -mpcrel by default for -mcpu=future From: will schmidt To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn Date: Mon, 06 Apr 2020 17:21:34 -0500 In-Reply-To: <20200406165204.GA15583@ibm-tinman.the-meissners.org> References: <20200406165204.GA15583@ibm-tinman.the-meissners.org> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.5 (3.28.5-5.el7) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138, 18.0.676 definitions=2020-04-06_10:2020-04-06, 2020-04-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 impostorscore=0 malwarescore=0 phishscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 adultscore=0 bulkscore=0 priorityscore=1501 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004060166 X-Spam-Status: No, score=-14.5 required=5.0 tests=BAYES_00, GIT_PATCH_2, GIT_PATCH_3, KAM_DMARC_STATUS, RCVD_IN_DNSWL_LOW, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: gcc-patches@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Gcc-patches mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 06 Apr 2020 22:21:44 -0000 On Mon, 2020-04-06 at 12:52 -0400, Michael Meissner via Gcc-patches wrote: Hi, Just a single extra blank line below. I'm still not a fan of the "Do not set..." comment, but will assume there is history that necessitates the comment. Other sections looked OK to me. Over to Segher. :-) Thanks, -Will > Commit message: > Enable -mpcrel for -mcpu=future if it is allowed by the ABI. > > 2020-04-06 Michael Meissner > > * config/rs6000/linux64.h (PCREL_SUPPORTED_BY_OS): Enable > prefixed PC-relative addressing if the ABI supports it. > * config/rs6000/rs6000-cpus.def (ISA_FUTURE_MASKS_SERVER): Do not > set OPTION_MASK_PREFIXED here. > * config/rs6000/rs6000.c (rs6000_option_override_internal): Enable > OPTION_MASK_PREFIXED and OPTION_MASK_PCREL on -mcpu=future by > default if the current ABI allows the options. > > I tested this on a little endian PowerPC power8 system, doing bootstrap and > make check. There were no regressions. I tested by hand the various > conditions where -mpcrel is not enabled, and they all used the normal power9 > TOC references. > > -mcpu=power9 generates TOC; > -mcpu=future -mcmodel=large generates TOC; > -mcpu=future -mcmode=small generates TOC; > -mcpu=future -mno-prefixed generates TOC; > -mcpu=future -mno-pcrel generates TOC; > -mcpu=future generates PC-relative. > ok, > --- /tmp/apbaWN_linux64.h 2020-04-03 17:15:05.059677000 -0400 > +++ gcc/config/rs6000/linux64.h 2020-04-03 17:01:05.580426937 -0400 > @@ -640,3 +640,10 @@ extern int dot_symbols; > enabling the __float128 keyword. */ > #undef TARGET_FLOAT128_ENABLE_TYPE > #define TARGET_FLOAT128_ENABLE_TYPE 1 > + > +/* Enable using prefixed PC-relative addressing on the 'future' machine if the > + ABI supports it. The ELF v2 ABI only supports PC-relative relocations for > + the medium code model. */ > +#define PCREL_SUPPORTED_BY_OS (TARGET_FUTURE && TARGET_PREFIXED \ > + && ELFv2_ABI_CHECK \ > + && (TARGET_CMODEL == CMODEL_MEDIUM)) ok > --- /tmp/XzRKno_rs6000-cpus.def 2020-04-03 17:15:05.068676928 -0400 > +++ gcc/config/rs6000/rs6000-cpus.def 2020-04-03 17:00:50.115550614 -0400 > @@ -75,10 +75,14 @@ > | OPTION_MASK_P8_VECTOR \ > | OPTION_MASK_P9_VECTOR) > > -/* Support for a future processor's features. Do not enable -mpcrel until it > - is fully functional. */ > +/* Support for a future processor's features. Do not set OPTION_MASK_PREFIXED > + or OPTION_MASK_PCREL here. Those options are enabled in the function > + rs6000_option_override if the ABI supports them. */ > #define ISA_FUTURE_MASKS_SERVER (ISA_3_0_MASKS_SERVER \ > - | OPTION_MASK_FUTURE \ > + | OPTION_MASK_FUTURE) > + > +/* Flags that need to be turned off if -mno-future. */ > +#define OTHER_FUTURE_MASKS (OPTION_MASK_PCREL \ > | OPTION_MASK_PREFIXED) > ok. > /* Flags that need to be turned off if -mno-future. */ > --- /tmp/nyxSRY_rs6000.c 2020-04-03 17:15:05.081676823 -0400 > +++ gcc/config/rs6000/rs6000.c 2020-04-03 17:03:19.846353197 -0400 > @@ -4020,6 +4020,12 @@ rs6000_option_override_internal (bool gl > rs6000_isa_flags &= ~OPTION_MASK_FLOAT128_HW; > } > > + /* Enable -mprefixed by default on 64-bit 'future' systems. */ > + if (TARGET_FUTURE && TARGET_POWERPC64 > + && (rs6000_isa_flags_explicit & OPTION_MASK_PREFIXED) == 0) > + rs6000_isa_flags |= OPTION_MASK_PREFIXED; > + > + extra blank line. > /* -mprefixed (and hence -mpcrel) requires -mcpu=future. */ > if (TARGET_PREFIXED && !TARGET_FUTURE) > { > @@ -4171,6 +4177,14 @@ rs6000_option_override_internal (bool gl > SUB3TARGET_OVERRIDE_OPTIONS; > #endif > > +#ifdef PCREL_SUPPORTED_BY_OS > + /* If the ABI has support for PC-relative relocations, enable it by > + default. */ > + if (PCREL_SUPPORTED_BY_OS > + && (rs6000_isa_flags_explicit & OPTION_MASK_PCREL) == 0) > + rs6000_isa_flags |= OPTION_MASK_PCREL; > +#endif > + ok. > /* -mpcrel requires -mcmodel=medium, but we can't check TARGET_CMODEL until > after the subtarget override options are done. */ > if (TARGET_PCREL && TARGET_CMODEL != CMODEL_MEDIUM) >