From patchwork Fri Feb 4 15:30:10 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michael Meissner X-Patchwork-Id: 50805 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 74C153858C20 for ; Fri, 4 Feb 2022 15:31:19 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 74C153858C20 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gcc.gnu.org; s=default; t=1643988679; bh=/3afO6GghMUFdQOClpG20quUQjAREQMF+2YnhIFhXQY=; h=Date:To:Subject:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:List-Subscribe:From:Reply-To:From; b=LSu5BnKuOLrJabV9eaT/8YqNpDtkDXay3pR8ZpGlav64bp8OGnzka0DT+b5yC7fP1 UXUEBR9LKATHQynf/BnvhkgldME2Yw3fno8OjBYJIR7rM9p6tjvl2NUyclHMvNwjOK 8TuB37yrC/Gw9m1mV8NYox85BkbTtyAKXYBJWQ/0= X-Original-To: gcc-patches@gcc.gnu.org Delivered-To: gcc-patches@gcc.gnu.org Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by sourceware.org (Postfix) with ESMTPS id 6966D385842E for ; Fri, 4 Feb 2022 15:30:20 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 6966D385842E Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 214EvkMf032196; Fri, 4 Feb 2022 15:30:19 GMT Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3e0qx0r1us-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Feb 2022 15:30:18 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 214EPHm1014820; Fri, 4 Feb 2022 15:30:18 GMT Received: from ppma03wdc.us.ibm.com (ba.79.3fa9.ip4.static.sl-reverse.com [169.63.121.186]) by mx0a-001b2d01.pphosted.com with ESMTP id 3e0qx0r1u1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Feb 2022 15:30:18 +0000 Received: from pps.filterd (ppma03wdc.us.ibm.com [127.0.0.1]) by ppma03wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 214FPaLa022044; Fri, 4 Feb 2022 15:30:17 GMT Received: from b01cxnp23033.gho.pok.ibm.com (b01cxnp23033.gho.pok.ibm.com [9.57.198.28]) by ppma03wdc.us.ibm.com with ESMTP id 3e0r0y55mj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 04 Feb 2022 15:30:17 +0000 Received: from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com [9.57.199.106]) by b01cxnp23033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 214FUDYu44433686 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 4 Feb 2022 15:30:13 GMT Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B4C032805E; Fri, 4 Feb 2022 15:30:13 +0000 (GMT) Received: from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DBF8F2805A; Fri, 4 Feb 2022 15:30:12 +0000 (GMT) Received: from toto.the-meissners.org (unknown [9.77.136.59]) by b01ledav001.gho.pok.ibm.com (Postfix) with ESMTPS; Fri, 4 Feb 2022 15:30:12 +0000 (GMT) Date: Fri, 4 Feb 2022 10:30:10 -0500 To: gcc-patches@gcc.gnu.org, Michael Meissner , Segher Boessenkool , David Edelsohn , Bill Schmidt , Peter Bergner , Will Schmidt Subject: [PATCH, V2] 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: 17ofU3paq9f5f4jllsbhhxkF0A2nD0t2 X-Proofpoint-ORIG-GUID: F4eHl4g9YhFBzK9zalCsFgb-89C_Ssew 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-02-04_06,2022-02-03_01,2021-12-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 mlxlogscore=999 suspectscore=0 spamscore=0 malwarescore=0 phishscore=0 priorityscore=1501 impostorscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2201110000 definitions=main-2202040086 X-Spam-Status: No, score=-10.8 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_EF, GIT_PATCH_0, KAM_MANYTO, RCVD_IN_MSPIKE_H5, RCVD_IN_MSPIKE_WL, 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" Use system default for long double unless it is overridden. If the user did not specify a default long double format when configuring GCC, use the long double default from the host compiler. I tested this on the following systems. There were no regressions: * Big endian Linux power8 using --with-cpu=power8 * Little endian Linux power9 using --with-cpu=power9 * Little endian Linux power10 using --with-cpu=power10 * Little endian Fedora rawhide power10 using --with-cpu=power10 that the default was changed to use IEEE 128-bit. I did not specify --with-long-double-format=ieee and it correctly defaulted to IEEE. * I also built a compiler on the above Fedora rawhide system, explicitly setting the type to IBM, and it did use the IBM format. Can I check this into the master branch? I also think this should be back ported to GCC 11. Can I do this also? 2022-02-04 Michael Meissner gcc/ * config/rs6000/rs6000.cc (TARGET_IEEEQUAD_DEFAULT): If the host compiler defaults to IEEE 128-bit long double, make that the default for this build unless it was overridden via the --with-long-double-format= configuration option. --- gcc/config/rs6000/rs6000.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/gcc/config/rs6000/rs6000.cc b/gcc/config/rs6000/rs6000.cc index 666dec694a8..0595855568c 100644 --- a/gcc/config/rs6000/rs6000.cc +++ b/gcc/config/rs6000/rs6000.cc @@ -91,10 +91,17 @@ 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. In addition, the --with-long-double-format + configuration option also sets TARGET_IEEEQUAD_DEFAULT. + + If the host compiler uses IEEE 128-bit long doubles, make the default to + also use IEEE 128-bit long doubles unless the --with-long-double-format + configuration switch was used. */ #ifndef TARGET_IEEEQUAD_DEFAULT #if !defined (POWERPC_LINUX) && !defined (POWERPC_FREEBSD) #define TARGET_IEEEQUAD_DEFAULT 1 +#elif defined (__LONG_DOUBLE_IEEE128__) +#define TARGET_IEEEQUAD_DEFAULT 1 #else #define TARGET_IEEEQUAD_DEFAULT 0 #endif