From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7189 invoked by alias); 7 Jun 2014 10:54:18 -0000 Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Received: (qmail 7180 invoked by uid 89); 7 Jun 2014 10:54:17 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: hall.aurel32.net Received: from hall.aurel32.net (HELO hall.aurel32.net) (195.154.112.97) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES128-SHA encrypted) ESMTPS; Sat, 07 Jun 2014 10:54:15 +0000 Received: from [2001:470:d4ed:0:5e26:aff:fe2b:6f5b] (helo=volta.rr44.fr) by hall.aurel32.net with esmtpsa (TLS1.2:RSA_AES_128_CBC_SHA1:128) (Exim 4.80) (envelope-from ) id 1WtEGK-0003Ka-5t for gcc-patches@gcc.gnu.org; Sat, 07 Jun 2014 12:54:12 +0200 Received: from aurel32 by volta.rr44.fr with local (Exim 4.82) (envelope-from ) id 1WtEGI-0003Kc-0v for gcc-patches@gcc.gnu.org; Sat, 07 Jun 2014 12:54:10 +0200 Date: Sat, 07 Jun 2014 10:54:00 -0000 From: Aurelien Jarno To: gcc-patches@gcc.gnu.org Subject: Re: [PATCH, PR61219]: Fix sNaN handling in ARM float to double conversion Message-ID: <20140607105409.GA12741@volta.rr44.fr> References: <20140518212338.GA16272@volta.rr44.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline In-Reply-To: <20140518212338.GA16272@volta.rr44.fr> User-Agent: Mutt/1.5.23 (2014-03-12) X-SW-Source: 2014-06/txt/msg00664.txt.bz2 Ping. Note that PR61219 is a duplicate of PR59833, so this patch actually fix PR59833. On Sun, May 18, 2014 at 11:23:38PM +0200, Aurelien Jarno wrote: > On ARM soft-float, the float to double conversion doesn't convert a sNaN > to qNaN as the IEEE Std 754 standard mandates: > > "Under default exception handling, any operation signaling an invalid > operation exception and for which a floating-point result is to be > delivered shall deliver a quiet NaN." > > Given the soft float ARM code ignores exceptions and always provides a > result, a float to double conversion of a signaling NaN should return a > quiet NaN. Fix this in extendsfdf2. > > > 2014-05-18 Aurelien Jarno > > PR target/61219 > * config/arm/ieee754-df.S (extendsfdf2): Convert sNaN to qNaN. > > > Index: libgcc/config/arm/ieee754-df.S > =================================================================== > --- libgcc/config/arm/ieee754-df.S (revision 210588) > +++ libgcc/config/arm/ieee754-df.S (working copy) > @@ -473,11 +473,15 @@ > eorne xh, xh, #0x38000000 @ fixup exponent otherwise. > RETc(ne) @ and return it. > > - teq r2, #0 @ if actually 0 > - do_it ne, e > - teqne r3, #0xff000000 @ or INF or NAN > + bics r2, r2, #0xff000000 @ isolate mantissa > + do_it eq @ if 0, that is ZERO or INF, > RETc(eq) @ we are done already. > > + teq r3, #0xff000000 @ check for NAN > + do_it eq, t > + orreq xh, xh, #0x00080000 @ change to quiet NAN > + RETc(eq) @ and return it. > + > @ value was denormalized. We can normalize it now. > do_push {r4, r5, lr} > mov r4, #0x380 @ setup corresponding exponent > > -- > Aurelien Jarno GPG: 4096R/1DDD8C9B > aurelien@aurel32.net http://www.aurel32.net -- Aurelien Jarno GPG: 4096R/1DDD8C9B aurelien@aurel32.net http://www.aurel32.net