public inbox for libc-ports@sourceware.org
 help / color / mirror / Atom feed
From: "Carlos O'Donell" <carlos@redhat.com>
To: Thomas Schwinge <thomas@codesourcery.com>
Cc: libc-alpha@sourceware.org, libc-ports@sourceware.org
Subject: Re: [attention machine maintainers] [PATCH] <math.h> issignaling
Date: Mon, 25 Mar 2013 15:54:00 -0000	[thread overview]
Message-ID: <51507329.3090904@redhat.com> (raw)
In-Reply-To: <87r4j73cqo.fsf@schwinge.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.

  parent reply	other threads:[~2013-03-25 15:54 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <8762148l9v.fsf@schwinge.name>
2013-03-22 11:18 ` Thomas Schwinge
2013-03-24 21:30   ` David Miller
2013-03-25  6:52     ` Thomas Schwinge
2013-03-25 18:39       ` David Miller
2013-03-25 15:54   ` Carlos O'Donell [this message]
2013-03-26 17:34   ` Joseph S. Myers
2013-03-28 12:16     ` Thomas Schwinge
2013-04-03 12:17       ` Thomas Schwinge

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=51507329.3090904@redhat.com \
    --to=carlos@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=libc-ports@sourceware.org \
    --cc=thomas@codesourcery.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).