From patchwork Mon Jan 31 18:49:03 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 50597 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 EA1A338515D3 for ; Mon, 31 Jan 2022 18:50:25 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org EA1A338515D3 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1643655026; bh=A/pBziXL7BOq4/Oo+wBg+2m3TD1+33hvPltW/1U1CMg=; h=Date:To:Subject:References:In-Reply-To:List-Id:List-Unsubscribe: List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To: From; b=kEASEfgcHxRUk9lFflpecKyu+AzqNTrjMiEIgX9mWwkJO6SwVxB2a6QrcsGNU822Y gkq+6yOhMKf1R1jhXYKzRrKJICGyS7TigZK3WGXKzU4P2qc/U8vUW4qhKoXlnPWu2H PnRYHWG6K/hdiTQlnVleLX5s7NkP2e3myN80ORIU= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by sourceware.org (Postfix) with ESMTPS id 4C767394881A for ; Mon, 31 Jan 2022 18:49:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 4C767394881A Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 20VGcMdV009039; Mon, 31 Jan 2022 18:49:08 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 3dxk0nkyq1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 31 Jan 2022 18:49:08 +0000 Received: from m0098413.ppops.net (m0098413.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 20VIROIx008710; Mon, 31 Jan 2022 18:49:08 GMT Received: from ppma04dal.us.ibm.com (7a.29.35a9.ip4.static.sl-reverse.com [169.53.41.122]) by mx0b-001b2d01.pphosted.com with ESMTP id 3dxk0nkypr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 31 Jan 2022 18:49:08 +0000 Received: from pps.filterd (ppma04dal.us.ibm.com [127.0.0.1]) by ppma04dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 20VIgY5J024762; Mon, 31 Jan 2022 18:49:07 GMT Received: from b03cxnp08028.gho.boulder.ibm.com (b03cxnp08028.gho.boulder.ibm.com [9.17.130.20]) by ppma04dal.us.ibm.com with ESMTP id 3dvw7a9p69-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 31 Jan 2022 18:49:07 +0000 Received: from b03ledav003.gho.boulder.ibm.com (b03ledav003.gho.boulder.ibm.com [9.17.130.234]) by b03cxnp08028.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 20VIn5WZ35914000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 31 Jan 2022 18:49:05 GMT Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B93F56A05D; Mon, 31 Jan 2022 18:49:05 +0000 (GMT) Received: from b03ledav003.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2EB7A6A064; Mon, 31 Jan 2022 18:49:05 +0000 (GMT) Received: from toto.the-meissners.org (unknown [9.77.136.59]) by b03ledav003.gho.boulder.ibm.com (Postfix) with ESMTPS; Mon, 31 Jan 2022 18:49:04 +0000 (GMT) Date: Mon, 31 Jan 2022 13:49:03 -0500 To: Michael Meissner , gcc-patches@gcc.gnu.org, Segher Boessenkool , David Edelsohn , Bill Schmidt , Peter Bergner , Will Schmidt Subject: Ping: [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 References: MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: WuoF9P_a-6YNgxzcvtjHilbMmyY8oF7T X-Proofpoint-GUID: y0KjJkXo3rwbEkI7YAJLX5jAKiGcFbaY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.62.513 definitions=2022-01-31_07,2022-01-31_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 suspectscore=0 spamscore=0 priorityscore=1501 mlxlogscore=999 phishscore=0 adultscore=0 malwarescore=0 clxscore=1011 impostorscore=0 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2201310120 X-Spam-Status: No, score=-11.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_MANYTO, SPF_HELO_NONE, SPF_PASS, TXREP, T_SCC_BODY_TEXT_LINE 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" This patch is critical to be installed when distros start making the switch from IBM 128-bit long double to IEEE 128-bit long double, so that users don't have to explicitly set the floating point format. Note because the patch was posted before the .c files were renamed to .cc, the following patch will be used instead once I get approval. Ideally, this patch should be back ported to GCC 11 also. [PATCH] 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? 2022-01-31 Michael Meissner gcc/ * config/rs6000/rs6000.cc (TARGET_IEEEQUAD_DEFAULT): If the compiler used to build the current compiler defaults to IEEE 128-bit long double, make that the default for this build. --- gcc/config/rs6000/rs6000.cc | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index e5471da4504..f5c089a2a26 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -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