aboutsummaryrefslogtreecommitdiff
path: root/gcc/doc
diff options
context:
space:
mode:
authorKaveh R. Ghazi <ghazi@caip.rutgers.edu>2008-05-18 23:19:38 +0000
committerKaveh Ghazi <ghazi@gcc.gnu.org>2008-05-18 23:19:38 +0000
commit05f41289d88658c05f34f713aed66054e12ff316 (patch)
tree90c75e8f2433a04ac95315cbba4166b8f7f7b3d2 /gcc/doc
parentd393bbd73754dfe54fac24d350c789316f17428f (diff)
downloadgcc-05f41289d88658c05f34f713aed66054e12ff316.zip
gcc-05f41289d88658c05f34f713aed66054e12ff316.tar.gz
gcc-05f41289d88658c05f34f713aed66054e12ff316.tar.bz2
re PR middle-end/35509 (builtin isinf() mismatch to compile-time substitution)
PR middle-end/35509 * builtins.c (mathfn_built_in_1): Renamed from mathfn_built_in. Add `implicit' parameter. Handle BUILT_IN_SIGNBIT. (mathfn_built_in): Rewrite in terms of mathfn_built_in_1. (fold_builtin_classify): Handle BUILT_IN_ISINF_SIGN. (fold_builtin_1): Likewise. * builtins.def (BUILT_IN_ISINF_SIGN): New. c-common.c (check_builtin_function_arguments): Handle BUILT_IN_ISINF_SIGN. * doc/extend.texi: Document __builtin_isinf_sign. * fold-const.c (operand_equal_p): Handle COND_EXPR. testsuite: * gcc.dg/builtins-error.c: Test __builtin_isinf_sign. * gcc.dg/tg-tests.h: Likewise. Mark variables volatile. * gcc.dg/torture/builtin-isinf_sign-1.c: New test. From-SVN: r135517
Diffstat (limited to 'gcc/doc')
-rw-r--r--gcc/doc/extend.texi15
1 files changed, 13 insertions, 2 deletions
diff --git a/gcc/doc/extend.texi b/gcc/doc/extend.texi
index f3c6c57..36e81ff 100644
--- a/gcc/doc/extend.texi
+++ b/gcc/doc/extend.texi
@@ -5768,6 +5768,7 @@ should be called and the @var{flag} argument passed to it.
@findex __builtin_isnormal
@findex __builtin_isgreater
@findex __builtin_isgreaterequal
+@findex __builtin_isinf_sign
@findex __builtin_isless
@findex __builtin_islessequal
@findex __builtin_islessgreater
@@ -6294,8 +6295,10 @@ the same names as the standard macros ( @code{isgreater},
@code{islessgreater}, and @code{isunordered}) , with @code{__builtin_}
prefixed. We intend for a library implementor to be able to simply
@code{#define} each standard macro to its built-in equivalent.
-In the same fashion, GCC provides @code{isfinite} and @code{isnormal}
-built-ins used with @code{__builtin_} prefixed.
+In the same fashion, GCC provides @code{isfinite}, @code{isinf_sign}
+and @code{isnormal} built-ins used with @code{__builtin_} prefixed.
+The @code{isinf} and @code{isnan} builtins appear both with and
+without the @code{__builtin_} prefix.
@deftypefn {Built-in Function} int __builtin_types_compatible_p (@var{type1}, @var{type2})
@@ -6579,6 +6582,14 @@ 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 will be negative 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}.