From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from smtp.smtpout.orange.fr (smtp06.smtpout.orange.fr [80.12.242.128]) by sourceware.org (Postfix) with ESMTPS id 3EA153858C39 for ; Sun, 16 Jan 2022 13:03:09 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 3EA153858C39 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=orange.fr Authentication-Results: sourceware.org; spf=none smtp.mailfrom=orange.fr Received: from [192.168.1.17] ([86.253.179.215]) by smtp.orange.fr with ESMTPA id 95BWnr2lQSrXT95BanONyf; Sun, 16 Jan 2022 14:03:07 +0100 X-ME-Helo: [192.168.1.17] X-ME-Auth: MDU4MTIxYWM4YWI0ZGE4ZTUwZWZmNTExZmI2ZWZlMThkM2ZhYiE5OWRkOGM= X-ME-Date: Sun, 16 Jan 2022 14:03:07 +0100 X-ME-IP: 86.253.179.215 Message-ID: Date: Sun, 16 Jan 2022 14:03:02 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.1 Subject: Re: [PATCH] Fortran: make IEEE_VALUE produce signaling NaNs Content-Language: fr To: FX , fortran@gcc.gnu.org Cc: gcc-patches@gcc.gnu.org References: <32DB646C-7282-42B3-B4E4-9ED1FC563A85@gmail.com> From: Mikael Morin In-Reply-To: <32DB646C-7282-42B3-B4E4-9ED1FC563A85@gmail.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.3 required=5.0 tests=BAYES_00, FREEMAIL_FROM, KAM_DMARC_STATUS, KAM_LAZY_DOMAIN_SECURITY, KAM_SHORT, NICE_REPLY_A, RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=no autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: fortran@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Fortran mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 16 Jan 2022 13:03:10 -0000 Hello, Le 10/01/2022 à 18:32, FX via Fortran a écrit : > Hi, > > Second part of a three-patch series to fix PR 82207 (https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82207), making gfortran handle signaling NaNs. This part fixes the library code implementing IEEE_VALUE. To do so, I switched that part of library code from Fortran to C, because in C we have access to all GCC built-ins related to NaNs/infinities/etc, which is super useful for generating the right bit patterns (instead of using roundabout ways, like the previous Fortran implementation, for which I am guilty). > > I needed to add to kinds.h the value of TINY for each floating-point (which is used to produce denormals, by halving TINY). > > The patch comes with a testcase, which is still conditional on issignaling support at this stage (and therefore will run on glibc targets only). > > I had to amend the gfortran.dg/ieee/ieee_10.f90 testcase, which produces signaling NaNs while -ffpe-trap=invalid is set. It passed before, but only by accident, because we were not actually generating signaling NaNs. I’m not sure what is the expected behaviour, but the patch does not affect the real behaviour. > > Bootstrapped and regtested on x86_64-pc-gnu-linux. OK to commit? > This looks good to me. Thanks.