From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from gate.crashing.org (gate.crashing.org [63.228.1.57]) by sourceware.org (Postfix) with ESMTP id 45D293895FF0; Thu, 15 Dec 2022 18:50:32 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 45D293895FF0 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=kernel.crashing.org Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=kernel.crashing.org Received: from gate.crashing.org (localhost.localdomain [127.0.0.1]) by gate.crashing.org (8.14.1/8.14.1) with ESMTP id 2BFInSgU007295; Thu, 15 Dec 2022 12:49:28 -0600 Received: (from segher@localhost) by gate.crashing.org (8.14.1/8.14.1/Submit) id 2BFInRcL007294; Thu, 15 Dec 2022 12:49:27 -0600 X-Authentication-Warning: gate.crashing.org: segher set sender to segher@kernel.crashing.org using -f Date: Thu, 15 Dec 2022 12:49:27 -0600 From: Segher Boessenkool To: Joseph Myers Cc: "Kewen.Lin" , Jakub Jelinek , Michael Meissner , gcc-patches@gcc.gnu.org, Peter Bergner , David Edelsohn , Will Schmidt , William Seurer Subject: Re: [PATCH 2/3] Make __float128 use the _Float128 type, PR target/107299 Message-ID: <20221215184927.GW25951@gate.crashing.org> References: <6b7325c6-6416-d64f-89a8-7341aeb8226c@linux.ibm.com> <3cbaa3d2-4327-c62a-2904-eac5ca506d20@linux.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.4.2.3i X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,JMQ_SPF_NEUTRAL,KAM_DMARC_STATUS,KAM_NUMSUBJECT,SPF_HELO_PASS,SPF_PASS,TXREP autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On Thu, Dec 15, 2022 at 06:28:19PM +0000, Joseph Myers wrote: > On Thu, 15 Dec 2022, Kewen.Lin via Gcc-patches wrote: > > By investigating the exposed NaN failures, I found it's due to that it wants > > to convert _Float128 type constant to long double type constant, it goes > > through function real_convert which clears the signalling bit in the context > > of !HONOR_SNANS (arg). > > > > if (r->cl == rvc_nan) > > r->signalling = 0; > > > > The test cases don't have the explicit option -fsignaling-nans, I'm inclined > > to believe it's intentional since there is only a sNaN generation. If so, > > we don't want this kind of conversion which is useless and can clear signalling > > bit unexpectedly, one shortcut is to just copy the corresponding REAL_VALUE_TYPE > > and rebuild with the given type if the modes are the same. > > I think this approach - treating floating-point conversions to a type with > the same mode consistently as a copy rather than a convertFormat operation > - is reasonable. Certainly. But different types with the same mode having different precision is not so very reasonable, and will likely cause other problems as well. We cannot use precision to order modes or types, that is the core problem. A conversion from IEEE QP to double-double (or vice versa) is neither widening nor narrowing. Segher