Message ID | Yf1Ggueq2MMZUnRS@toto.the-meissners.org |
---|---|
State | New |
Headers |
Return-Path: <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> 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 <patchwork@sourceware.org>; 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 <gcc-patches@gcc.gnu.org>; 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 <meissner@linux.ibm.com>, Segher Boessenkool <segher@kernel.crashing.org>, David Edelsohn <dje.gcc@gmail.com>, Bill Schmidt <wschmidt@linux.ibm.com>, Peter Bergner <bergner@linux.ibm.com>, Will Schmidt <will_schmidt@vnet.ibm.com> Subject: [PATCH, V2] Use system default for long double if not specified on PowerPC. Message-ID: <Yf1Ggueq2MMZUnRS@toto.the-meissners.org> Mail-Followup-To: Michael Meissner <meissner@linux.ibm.com>, gcc-patches@gcc.gnu.org, Segher Boessenkool <segher@kernel.crashing.org>, David Edelsohn <dje.gcc@gmail.com>, Bill Schmidt <wschmidt@linux.ibm.com>, Peter Bergner <bergner@linux.ibm.com>, Will Schmidt <will_schmidt@vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii 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 <gcc-patches.gcc.gnu.org> List-Unsubscribe: <https://gcc.gnu.org/mailman/options/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=unsubscribe> List-Archive: <https://gcc.gnu.org/pipermail/gcc-patches/> List-Post: <mailto:gcc-patches@gcc.gnu.org> List-Help: <mailto:gcc-patches-request@gcc.gnu.org?subject=help> List-Subscribe: <https://gcc.gnu.org/mailman/listinfo/gcc-patches>, <mailto:gcc-patches-request@gcc.gnu.org?subject=subscribe> From: Michael Meissner via Gcc-patches <gcc-patches@gcc.gnu.org> Reply-To: Michael Meissner <meissner@linux.ibm.com> Errors-To: gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org Sender: "Gcc-patches" <gcc-patches-bounces+patchwork=sourceware.org@gcc.gnu.org> |
Series |
[V2] Use system default for long double if not specified on PowerPC.
|
|
Commit Message
Michael Meissner
Feb. 4, 2022, 3:30 p.m. UTC
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 <meissner@the-meissners.org> 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(-)
Comments
On Feb 04 2022, Michael Meissner via Gcc-patches wrote: > If the user did not specify a default long double format when configuring > GCC, use the long double default from the host compiler. That doesn't make any sense. The host compiler can be any random compiler completely unrelated to the target.
On Fri, Feb 04, 2022 at 04:43:53PM +0100, Andreas Schwab wrote: > On Feb 04 2022, Michael Meissner via Gcc-patches wrote: > > If the user did not specify a default long double format when configuring > > GCC, use the long double default from the host compiler. > > That doesn't make any sense. The host compiler can be any random > compiler completely unrelated to the target. Yes, see <https://gcc.gnu.org/onlinedocs/gccint/Portability.html>. It also goes against the basic GCC policy that results should be reproducible. We *do* have some existing cases where the compiler changes behaviour based on whether e.g. binutils is too old to have a certain feature. Either a) such cases are ancient, everyone has a newer version in practice, we could just require this; or b) those cases cause no end of problems, everyone is much better off if we tell the user at configuration time to get newer stuff, or if it causes a clear error in the first place we can just let it do that. Also. We cannot have confidence that our compiler does anything correct or good if we cannot test it. If we let the testing matrix explode exponentially we cannot test even the reasonable cases. It will make the support job a lot harder as well: users will not report what they used when configuring and building the compiler when they report a problem, even more so because in all likelyhood it was someone else who did that building! And our own diagnostic for this (the gcc -v output) dows not say what defaults the build compiler used. I already NAKed this patch for weeks, and I do it again now. Segher
On 2/4/22 12:03 PM, Segher Boessenkool wrote: > On Fri, Feb 04, 2022 at 04:43:53PM +0100, Andreas Schwab wrote: >> On Feb 04 2022, Michael Meissner via Gcc-patches wrote: >>> If the user did not specify a default long double format when configuring >>> GCC, use the long double default from the host compiler. >> >> That doesn't make any sense. The host compiler can be any random >> compiler completely unrelated to the target. > > Yes, see <https://gcc.gnu.org/onlinedocs/gccint/Portability.html>. [snip] > I already NAKed this patch for weeks, and I do it again now. Did you NAK the patch due to its specific implementation or are you even against the aim of the patch, namely that gcc configure tries to determine the long double default of the underlying system and matches that? Peter
On Fri, Feb 04, 2022 at 02:10:03PM -0600, Peter Bergner wrote: > On 2/4/22 12:03 PM, Segher Boessenkool wrote: > > On Fri, Feb 04, 2022 at 04:43:53PM +0100, Andreas Schwab wrote: > >> On Feb 04 2022, Michael Meissner via Gcc-patches wrote: > >>> If the user did not specify a default long double format when configuring > >>> GCC, use the long double default from the host compiler. > >> > >> That doesn't make any sense. The host compiler can be any random > >> compiler completely unrelated to the target. > > > > Yes, see <https://gcc.gnu.org/onlinedocs/gccint/Portability.html>. > [snip] > > I already NAKed this patch for weeks, and I do it again now. > > Did you NAK the patch due to its specific implementation or are you > even against the aim of the patch, namely that gcc configure tries > to determine the long double default of the underlying system and > matches that? As I said before, I didn't even read the patch, just the one line summary was enough for a NAK. If the patch in fact does something else, then it is still incorrect, and needs a very different subject and summary. I hope you see how "using the default of the underlying system" is questionable in itself, but is something completely different from using the default of the build compiler, which makes even less sense. You want a configure flag to set the default long double format to be IEEE QP. This cannot be enabled by default until a (big) majority of systems "in the wild" will work with that (only on powerpc64le-linux or some *big* thing like that is fine, only default it to enabled there then). At that point in time, configure shouls complain, and the user would have to explicitly *disable* it to build without that support. Anything else is pretend progress and costs us too much. Yes, this is a "flag day", but only for the default. We will still support the double-double format for a loooooong time, if only because there are no concrete plans for moving most of its users (or no plans at all is more truthful actually)! Segher
On 2/4/22 4:26 PM, Segher Boessenkool wrote: > As I said before, I didn't even read the patch, just the one line > summary was enough for a NAK. If the patch in fact does something else, > then it is still incorrect, and needs a very different subject and > summary. > > I hope you see how "using the default of the underlying system" is > questionable in itself, but is something completely different from using > the default of the build compiler, which makes even less sense. > > You want a configure flag to set the default long double format to be > IEEE QP. This cannot be enabled by default until a (big) majority of > systems "in the wild" will work with that (only on powerpc64le-linux > or some *big* thing like that is fine, only default it to enabled there > then). At that point in time, configure shouls complain, and the user > would have to explicitly *disable* it to build without that support. Can you please clarify one thing for me. Do you think it's possible that we can come up with some type of configure patch that automatically sets the long double default given something on the system we can test for or do you think that's impossible and we'll just have to live with explicitly using a configure option to set the default? ...at least until some time in the far future when enough systems/distros have changed to IEEE128 that we can change the default without a test. Peter
On Feb 08 2022, Peter Bergner wrote: > Can you please clarify one thing for me. Do you think it's possible > that we can come up with some type of configure patch that automatically > sets the long double default given something on the system we can test > for or do you think that's impossible and we'll just have to live with > explicitly using a configure option to set the default? It should be handled the same as the double->long double switch.
Hi Andreas, On Tue, Feb 08, 2022 at 06:36:57PM +0100, Andreas Schwab wrote: > On Feb 08 2022, Peter Bergner wrote: > > Can you please clarify one thing for me. Do you think it's possible > > that we can come up with some type of configure patch that automatically > > sets the long double default given something on the system we can test > > for or do you think that's impossible and we'll just have to live with > > explicitly using a configure option to set the default? > > It should be handled the same as the double->long double switch. So how was that done? It's not something I can find online ("long double conversion" does not find it, heh). Was it just a flag day where the default was changed? IMO it is a bad idea to change configuration without the user asking for it (and even doing that silently). It is hard enough and painful enough to do this conversion in the first place, we do not need twice as many user configurations (that are not even shown by gcc -v, etc.) Testing is hard. Testing twice as many configurations is twice as hard. The only outcome that can be reasonably expected is that at least half of the new configurations will not be tested at all. And that is very expensive, because there will be a lot of wasted work and frustration for whoever gets to handle bug reports, and ditto for whoever gets to deal with a bug that was not handled (aka, a worse user experience). The apparent goal here is to give users compilers that default to IEEE QP long double earlier. That is a fine goal, but it should be achieved bu actually changing the default earlier, not by leaving behind a large fraction of users! Segher
On Feb 09 2022, Segher Boessenkool wrote: > Hi Andreas, > > On Tue, Feb 08, 2022 at 06:36:57PM +0100, Andreas Schwab wrote: >> On Feb 08 2022, Peter Bergner wrote: >> > Can you please clarify one thing for me. Do you think it's possible >> > that we can come up with some type of configure patch that automatically >> > sets the long double default given something on the system we can test >> > for or do you think that's impossible and we'll just have to live with >> > explicitly using a configure option to set the default? >> >> It should be handled the same as the double->long double switch. > > So how was that done? I thnk commit ed965309dad added that.
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