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.gli...@inria.fr>

        PR middle-end/57219
        * doc/extend.texi (__builtin_isinf_sign): Restrict the return
        values to -1, 0 and 1.

--
Marc Glisse
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

Reply via email to