Patchwork Document __builtin_isinf_sign more precisely

login
register
mail settings
Submitter Marc Glisse
Date June 9, 2013, 7:18 p.m.
Message ID <alpine.DEB.2.02.1306092102390.24602@stedding.saclay.inria.fr>
Download mbox | patch
Permalink /patch/250086/
State New
Headers show

Comments

Marc Glisse - June 9, 2013, 7:18 p.m.
Hello,

this patch documents that __builtin_isinf_sign returns +-1 for +-Inf. This 
builtin was created so it could be used by a libc that has a stronger 
guarantee than the standard, and for glibc that means returning +-1, which 
is what the code already does.

2013-06-10  Marc Glisse  <marc.glisse@inria.fr>

 	PR middle-end/57219
 	* doc/extend.texi (__builtin_isinf_sign): Restrict the return
 	values to -1, 0 and 1.
Marc Glisse - June 26, 2013, 2:16 p.m.
Ping http://gcc.gnu.org/ml/gcc-patches/2013-06/msg00475.html

On Sun, 9 Jun 2013, Marc Glisse wrote:

> Hello,
>
> this patch documents that __builtin_isinf_sign returns +-1 for +-Inf. This 
> builtin was created so it could be used by a libc that has a stronger 
> guarantee than the standard, and for glibc that means returning +-1, which is 
> what the code already does.
>
> 2013-06-10  Marc Glisse  <marc.glisse@inria.fr>
>
> 	PR middle-end/57219
> 	* doc/extend.texi (__builtin_isinf_sign): Restrict the return
> 	values to -1, 0 and 1.
Richard Guenther - Aug. 27, 2013, 7:47 a.m.
On Wed, Jun 26, 2013 at 4:16 PM, Marc Glisse <marc.glisse@inria.fr> wrote:
> Ping http://gcc.gnu.org/ml/gcc-patches/2013-06/msg00475.html

Ok.

Thanks,
Richard.

>
> On Sun, 9 Jun 2013, Marc Glisse wrote:
>
>> Hello,
>>
>> this patch documents that __builtin_isinf_sign returns +-1 for +-Inf. This
>> builtin was created so it could be used by a libc that has a stronger
>> guarantee than the standard, and for glibc that means returning +-1, which
>> is what the code already does.
>>
>> 2013-06-10  Marc Glisse  <marc.glisse@inria.fr>
>>
>>         PR middle-end/57219
>>         * doc/extend.texi (__builtin_isinf_sign): Restrict the return
>>         values to -1, 0 and 1.
>
>
> --
> Marc Glisse

Patch

Index: doc/extend.texi

===================================================================
--- doc/extend.texi	(revision 199867)

+++ doc/extend.texi	(working copy)

@@ -8603,22 +8603,23 @@  Similar to @code{__builtin_inf}, except

 Similar to @code{__builtin_inf}, except the return type is @code{float}.
 This function is suitable for implementing the ISO C99 macro @code{INFINITY}.
 @end deftypefn
 
 @deftypefn {Built-in Function} {long double} __builtin_infl (void)
 Similar to @code{__builtin_inf}, except the return
 type is @code{long double}.
 @end deftypefn
 
 @deftypefn {Built-in Function} int __builtin_isinf_sign (...)
-Similar to @code{isinf}, except the return value is negative for

-an argument of @code{-Inf}.  Note while the parameter list is an

+Similar to @code{isinf}, except the return value is -1 for

+an argument of @code{-Inf} and 1 for an argument of @code{+Inf}.

+Note while the parameter list is an

 ellipsis, this function only accepts exactly one floating-point
 argument.  GCC treats this parameter as type-generic, which means it
 does not do default promotion from float to double.
 @end deftypefn
 
 @deftypefn {Built-in Function} double __builtin_nan (const char *str)
 This is an implementation of the ISO C99 function @code{nan}.
 
 Since ISO C99 defines this function in terms of @code{strtod}, which we
 do not implement, a description of the parsing is in order.  The string