From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 19868 invoked by alias); 26 Mar 2013 17:34:05 -0000 Mailing-List: contact libc-ports-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Post: List-Help: , Sender: libc-ports-owner@sourceware.org Received: (qmail 19809 invoked by uid 89); 26 Mar 2013 17:33:54 -0000 X-Spam-SWARE-Status: No, score=-2.4 required=5.0 tests=AWL,BAYES_00 autolearn=ham version=3.3.1 X-Spam-User: qpsmtpd, 2 recipients Received: from relay1.mentorg.com (HELO relay1.mentorg.com) (192.94.38.131) by sourceware.org (qpsmtpd/0.84/v0.84-167-ge50287c) with ESMTP; Tue, 26 Mar 2013 17:33:51 +0000 Received: from svr-orw-fem-01.mgc.mentorg.com ([147.34.98.93]) by relay1.mentorg.com with esmtp id 1UKXkr-0000Gv-JS from joseph_myers@mentor.com ; Tue, 26 Mar 2013 10:33:49 -0700 Received: from SVR-IES-FEM-01.mgc.mentorg.com ([137.202.0.104]) by svr-orw-fem-01.mgc.mentorg.com over TLS secured channel with Microsoft SMTPSVC(6.0.3790.4675); Tue, 26 Mar 2013 10:33:49 -0700 Received: from digraph.polyomino.org.uk (137.202.0.76) by SVR-IES-FEM-01.mgc.mentorg.com (137.202.0.104) with Microsoft SMTP Server id 14.1.289.1; Tue, 26 Mar 2013 17:33:48 +0000 Received: from jsm28 (helo=localhost) by digraph.polyomino.org.uk with local-esmtp (Exim 4.76) (envelope-from ) id 1UKXko-0003LN-VU; Tue, 26 Mar 2013 17:33:47 +0000 Date: Tue, 26 Mar 2013 17:34:00 -0000 From: "Joseph S. Myers" To: Thomas Schwinge CC: , Subject: Re: [attention machine maintainers] [PATCH] issignaling In-Reply-To: <87r4j73cqo.fsf@schwinge.name> Message-ID: References: <8762148l9v.fsf@schwinge.name> <87r4j73cqo.fsf@schwinge.name> MIME-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" X-SW-Source: 2013-03/txt/msg00161.txt.bz2 On Fri, 22 Mar 2013, Thomas Schwinge wrote: > PowerPC -m64: > > math/basic-test.out: > Failure: double x = (double) (long double) sNaN, !issignaling > > That is, this type cast -- which is a IEEE 754-2008 general-computational > convertFormat operation (IEEE 754-2008, 5.4.2) -- does not turn the sNaN > into a qNaN (whilst raising an INVALID exception; not checked here), > which is contrary to IEEE 754-2008 5.1 and 7.2. This I consider a > compiler issue (powerpc-linux-gnu-gcc (Sourcery CodeBench 2012.09-92) > 4.7.2). Such a bug (assuming present in GCC trunk for 4.9) should be filed in GCC Bugzilla (and I suppose a new math-tests.h macro used to disable the test in question for older compilers). Though I guess it might only be desired to change this for -fsignaling-nans. > MIPS32 O32: > > math/test-double.out, math/test-idouble.out: > Result: > is: sNaN > should be: qNaN > > Seen for qNaN inputs with: pow, remainder. The issue for remainder comes from the use of NaN representations in sysdeps/ieee754/dbl-64/e_remainder.c. In all such cases, for NaN input an output NaN should be generated by arithmetic involving the inputs, and for non-NaN input an output NaN should be generated by an arithmetic operation that generates a NaN and raises INVALID (without other exceptions). The cases of missing INVALID for this (which only appear with -lieee, so need testsuite enhancements to test that case in order to be able to test fixes for them) are bug 14686. As usual, file bugs with testcases in glibc Bugzilla for the MIPS-specific problems before fixing them. > diff --git NEWS NEWS > index f0965d6..0d70ead 100644 > --- NEWS > +++ NEWS > @@ -26,6 +26,8 @@ Version 2.18 > > * Added a benchmark framework to track performance of functions in glibc. > > +* New macro named issignaling to check for a signaling NaN (sNaN). > + This is currently GNU-specific. "GNU-specific" is a bit misleading there. I think you mean "only defined if _GNU_SOURCE is defined" (but you should note it comes from draft TS 18661). > +@comment math.h > +@comment GNU > +@deftypefn {Macro} int issignaling (@emph{float-type} @var{x}) > +This macro returns a nonzero value if @var{x} is a signaling NaN > +(sNaN). It is a GNU extension. A GNU extension based on draft TS 18661. > +#undef __issignaling Why the #undef? > +int __issignaling (double x) Return type on a separate line. Same comments apply to the other implementations. > +{ > +#ifdef HIGH_ORDER_BIT_IS_SET_FOR_SNAN > + u_int32_t hxi; (I tend to think that the C99 names such as uint32_t should be preferred, but since the libm code seems to be using the legacy names universally, any such change should probably first be made globally to existing code if there's consensus, rather than making this code in particular different.) -- Joseph S. Myers joseph@codesourcery.com