This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [attention machine maintainers] [PATCH] <math.h> issignaling
- From: "Carlos O'Donell" <carlos at redhat dot com>
- To: Thomas Schwinge <thomas at codesourcery dot com>
- Cc: libc-alpha at sourceware dot org, libc-ports at sourceware dot org
- Date: Mon, 25 Mar 2013 11:54:17 -0400
- Subject: Re: [attention machine maintainers] [PATCH] <math.h> issignaling
- References: <8762148l9v dot fsf at schwinge dot name> <87r4j73cqo dot fsf at schwinge dot name>
On 03/22/2013 07:17 AM, Thomas Schwinge wrote:
> Hi!
>
> On Wed, 06 Mar 2013 18:56:28 +0100, I wrote:
>> In IEEE 754-1985, ÂAnnex A Recommended Functions and PredicatesÂ, 10) a
>> function to distinguish signaling from quiet NaNs is suggested. This is
>> further elaborated in IEEE 754-2008, Â5.7.2 General operations as a
>> isSignaling operation. Such a macro/function is not yet part of any
>> published revision of the C programming language standard, but has been
>> under discussion for some time alreay, see for example in
>> <http://www.open-std.org/jtc1/sc22/wg14/www/docs/PostPortland2012.htm>'s
>> N1664 (the latest of its kind that is publically available, as far as I
>> know), Â14.7 Inquiry macros [...] Suggested change to C11: [...] 7.12.3.7
>> The issignaling macroÂ:
>>
>> | Synopsis
>> | [1] #define __STDC_WANT_IEC_00000_EXT1__
>> | #include <math.h>
>> | int issignaling(real-floating x);
>> |
>> | Description
>> | [2] The issignaling macro determines whether its argument value is a signaling NaN, without
>> | raising a floating-point exception.
>> |
>> | Returns
>> | [3] The issignaling macro returns a nonzero value if and only if its argument is a signaling NaN.
>
> I have now pushed a new version of this patch in the
> tschwinge/issignaling branch. Would machine maintainers please test this
> branch/patch and report back? Any new testsuite failures are
> interesting, and especially also any differences in math/*.out files.
>
> Carlos, is my understanding correct (based on a Wikipedia article), that
> HPPA is (as MIPS) one of the few HIGH_ORDER_BIT_IS_SET_FOR_SNAN (see the
> patch) architectures?
Correct.
I have verified this for you here:
~~~
PA-RISC 2.0 Architecture:
Floating-point Coprocessor 8-7
"If the number is a NaN, then the leftmost bit in the fraction, b1,
determines whether the NaN is signaling or quiet. If b1 is 1, the
NaN is a signaling NaN. If b1 is 0, it is a quiet NaN."
~~~
> --- /dev/null
> +++ ports/sysdeps/hppa/math_private.h
> @@ -0,0 +1,27 @@
> +/* Internal math stuff. HPPA version.
> + Copyright (C) 2013 Free Software Foundation, Inc.
> + This file is part of the GNU C Library.
> +
> + The GNU C Library is free software; you can redistribute it and/or
> + modify it under the terms of the GNU Lesser General Public
> + License as published by the Free Software Foundation; either
> + version 2.1 of the License, or (at your option) any later version.
> +
> + The GNU C Library is distributed in the hope that it will be useful,
> + but WITHOUT ANY WARRANTY; without even the implied warranty of
> + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + Lesser General Public License for more details.
> +
> + You should have received a copy of the GNU Lesser General Public
> + License along with the GNU C Library; if not, see
> + <http://www.gnu.org/licenses/>. */
> +
> +#ifndef _MATH_PRIVATE_H
> +
> +/* One of the few architectures where the meaning of the quiet/signaling bit is
> + inverse to IEEE 754-2008 (as well as common practice for IEEE 754-1985). */
> +#define HIGH_ORDER_BIT_IS_SET_FOR_SNAN
> +
> +#include_next <math_private.h>
> +
> +#endif
This looks good to me.
Cheers,
Carlos.