From patchwork Wed Jan 12 18:04:19 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 49933 Return-Path: X-Original-To: patchwork@sourceware.org Delivered-To: patchwork@sourceware.org Received: from server2.sourceware.org (localhost [IPv6:::1]) by sourceware.org (Postfix) with ESMTP id 92D7A382EBE3 for ; Wed, 12 Jan 2022 18:04:54 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 92D7A382EBE3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1642010694; bh=d17dNIpbz6Oh4pieQzPVthIQ+Q8VTRtJGh+4krBaWzo=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=w8TksTmJ10C952a3QTZsCj1VkYjO7izXAvgGCYKEeZRXrGp4qhS7kL+IdTKzxta69 N6eSrzrRuzhsJLZgV6JS3Rx1kePykTlnCgZGgp3vyCdayN5D71FnzAWrbhjYg26bxz pUppty2EFopmSlesdlHpF6pHnampS6MJAOYXAFtA= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id DF4593858406 for ; Wed, 12 Jan 2022 18:04:25 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DF4593858406 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20CGE0PY015829; Wed, 12 Jan 2022 18:04:25 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3dhycgxpkv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jan 2022 18:04:25 +0000 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 20CHpU2o023815; Wed, 12 Jan 2022 18:04:24 GMT Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0a-001b2d01.pphosted.com with ESMTP id 3dhycgxpkm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jan 2022 18:04:24 +0000 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 20CI2M4c022325; Wed, 12 Jan 2022 18:04:24 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma01wdc.us.ibm.com with ESMTP id 3df28b0qau-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 12 Jan 2022 18:04:24 +0000 Received: from b01ledav004.gho.pok.ibm.com (b01ledav004.gho.pok.ibm.com [9.57.199.109]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 20CI4MGO28311892 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Jan 2022 18:04:22 GMT Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 94390112072; Wed, 12 Jan 2022 18:04:22 +0000 (GMT) Received: from b01ledav004.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BAB1A112069; Wed, 12 Jan 2022 18:04:21 +0000 (GMT) Received: from toto.the-meissners.org (unknown [9.77.149.10]) by b01ledav004.gho.pok.ibm.com (Postfix) with ESMTPS; Wed, 12 Jan 2022 18:04:21 +0000 (GMT) Date: Wed, 12 Jan 2022 13:04:19 -0500 To: gcc-patches@gcc.gnu.org, Michael Meissner , Segher Boessenkool , David Edelsohn , Bill Schmidt , Peter Bergner , Will Schmidt Subject: [PATCH] Use system default for long double if not specified on PowerPC. Message-ID: Mail-Followup-To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn , Bill Schmidt , Peter Bergner , Will Schmidt MIME-Version: 1.0 Content-Disposition: inline X-TM-AS-GCONF: 00 X-Proofpoint-GUID: LoDoREdWBg3u9uGphfMdt3oETYYPL83n X-Proofpoint-ORIG-GUID: HSlRe8j4B8JARZcXq5wvmtaUdfEkjT-w X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.790,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-12_05,2022-01-11_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 phishscore=0 malwarescore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2110150000 definitions=main-2201120109 X-Spam-Status: No, score=-10.5 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_MANYTO, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) 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-Patchwork-Original-From: Michael Meissner via Gcc-patches From: Michael Meissner Reply-To: Michael Meissner Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" Use system default for long double if not specified on PowerPC. If the user did not specify a default long double format, use the long double default for the build compiler for the long double default. This patch will allow compilers built on a distribution that has changed the 128-bit floating point format to use the default used on the system. I did a normal normal bootstrap and make check regression on a little endian power9 system and there were no regressions. In addition, I built a compiler where I configured the default to use IEEE 128-bit floating point for long double. I then used that compiler to build a bootstrap with this patch applied and I did not set the floating point format. I verified that the compiler built with this patch defaults long double to be IEEE 128-bit. Can I apply this patch to the trunk for GCC 12? gcc/ 2022-01-12 Michael Meissner * config/rs6000/rs6000.c (TARGET_IEEEQUAD_DEFAULT): If the compiler used to build this compiler defaults long double to IEEE 128-bit, then make it the default for the target. --- gcc/config/rs6000/rs6000.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/config/rs6000/rs6000.c b/gcc/config/rs6000/rs6000.c index 0e3481c8327..e59f7aa49c8 100644 --- a/gcc/config/rs6000/rs6000.c +++ b/gcc/config/rs6000/rs6000.c @@ -91,14 +91,22 @@ explicitly redefine TARGET_IEEEQUAD and TARGET_IEEEQUAD_DEFAULT to 0, so those systems will not pick up this default. This needs to be after all of the include files, so that POWERPC_LINUX and POWERPC_FREEBSD are - properly defined. */ + properly defined. + + If we are being built by a compiler that uses IEEE 128-bit as the default + long double and no explicit long double format was selected, then also + default long double to IEEE 128-bit. */ #ifndef TARGET_IEEEQUAD_DEFAULT #if !defined (POWERPC_LINUX) && !defined (POWERPC_FREEBSD) #define TARGET_IEEEQUAD_DEFAULT 1 #else +#ifdef __LONG_DOUBLE_IEEE128__ +#define TARGET_IEEEQUAD_DEFAULT 1 +#else #define TARGET_IEEEQUAD_DEFAULT 0 #endif #endif +#endif /* Don't enable PC-relative addressing if the target does not support it. */ #ifndef PCREL_SUPPORTED_BY_OS