From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by sourceware.org (Postfix) with ESMTPS id F11663895FEA for ; Thu, 15 Dec 2022 18:56:41 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org F11663895FEA Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1671130601; h=from:from:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:in-reply-to:in-reply-to: references:references; bh=ddkmjNSiamKpEbMt624NvdVOV1igx4aF/8RYVTwO+Is=; b=Byh0GIujih2aqdZQFbVlDS0wiBh5UJ95KlVAsveaCDSuEteZZlcdSbXEn5JNx4KeAlSDkJ ErnvsMJZn6lIq87cwKnaAlClrBUebMKTOwA1uCyOtgMBbq2FAnJtpq8RkTdZAhFoeVTm80 PyZ2V8xIdD1qJuKAiq/jbCl/O7Casxw= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-646-ATuWvumFPvG3UYvxqZuCdw-1; Thu, 15 Dec 2022 13:56:30 -0500 X-MC-Unique: ATuWvumFPvG3UYvxqZuCdw-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 176EC2802BA2; Thu, 15 Dec 2022 18:56:30 +0000 (UTC) Received: from tucnak.zalov.cz (unknown [10.39.195.114]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E439C492C14; Thu, 15 Dec 2022 18:56:27 +0000 (UTC) Received: from tucnak.zalov.cz (localhost [127.0.0.1]) by tucnak.zalov.cz (8.17.1/8.17.1) with ESMTPS id 2BFIuH3p3331616 (version=TLSv1.3 cipher=TLS_AES_256_GCM_SHA384 bits=256 verify=NOT); Thu, 15 Dec 2022 19:56:17 +0100 Received: (from jakub@localhost) by tucnak.zalov.cz (8.17.1/8.17.1/Submit) id 2BFIuEKI3331615; Thu, 15 Dec 2022 19:56:14 +0100 Date: Thu, 15 Dec 2022 19:56:14 +0100 From: Jakub Jelinek To: Segher Boessenkool Cc: Joseph Myers , "Kewen.Lin" , 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: Reply-To: Jakub Jelinek References: <6b7325c6-6416-d64f-89a8-7341aeb8226c@linux.ibm.com> <3cbaa3d2-4327-c62a-2904-eac5ca506d20@linux.ibm.com> <20221215184927.GW25951@gate.crashing.org> MIME-Version: 1.0 In-Reply-To: <20221215184927.GW25951@gate.crashing.org> X-Scanned-By: MIMEDefang 3.1 on 10.11.54.9 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,KAM_NUMSUBJECT,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE,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 12:49:27PM -0600, Segher Boessenkool wrote: > 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. Sure. For optabs, I bet we don't necessarily need to care that much, if precision is the same, we can ask for widening and narrowing conversion and expect only one to be implemented or both doing the same thing between such modes. But when using libcalls, which library function we use is quite important because not all of them might be actually implemented in the library (better keep doing what we've done before). Jakub