Commit 32101f99 by Kaveh R. Ghazi Committed by Kaveh Ghazi

builtins.c (fold_builtin_fpclassify): Fix spelling of FP_INFINITE.

	* builtins.c (fold_builtin_fpclassify): Fix spelling of FP_INFINITE.
	* doc/extend.texi: Likewise.

testsuite:
	* gcc.dg/tg-tests.h: Fix spelling of FP_INFINITE.

From-SVN: r135844
parent c9db440d
2008-05-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* builtins.c (fold_builtin_fpclassify): Fix spelling of FP_INFINITE.
* doc/extend.texi: Likewise.
2008-05-23 DJ Delorie <dj@redhat.com> 2008-05-23 DJ Delorie <dj@redhat.com>
* config/m32c/jump.md (untyped_call): Add. * config/m32c/jump.md (untyped_call): Add.
......
...@@ -9748,14 +9748,15 @@ fold_builtin_classify (tree fndecl, tree arg, int builtin_index) ...@@ -9748,14 +9748,15 @@ fold_builtin_classify (tree fndecl, tree arg, int builtin_index)
This builtin will generate code to return the appropriate floating This builtin will generate code to return the appropriate floating
point classification depending on the value of the floating point point classification depending on the value of the floating point
number passed in. The possible return values must be supplied as number passed in. The possible return values must be supplied as
int arguments to the call in the following order: FP_NAN, FP_INF, int arguments to the call in the following order: FP_NAN, FP_INFINITE,
FP_NORMAL, FP_SUBNORMAL and FP_ZERO. The ellipses is for exactly FP_NORMAL, FP_SUBNORMAL and FP_ZERO. The ellipses is for exactly
one floating point argument which is "type generic". */ one floating point argument which is "type generic". */
static tree static tree
fold_builtin_fpclassify (tree exp) fold_builtin_fpclassify (tree exp)
{ {
tree fp_nan, fp_inf, fp_normal, fp_subnormal, fp_zero, arg, type, res, tmp; tree fp_nan, fp_infinite, fp_normal, fp_subnormal, fp_zero,
arg, type, res, tmp;
enum machine_mode mode; enum machine_mode mode;
REAL_VALUE_TYPE r; REAL_VALUE_TYPE r;
char buf[128]; char buf[128];
...@@ -9767,7 +9768,7 @@ fold_builtin_fpclassify (tree exp) ...@@ -9767,7 +9768,7 @@ fold_builtin_fpclassify (tree exp)
return NULL_TREE; return NULL_TREE;
fp_nan = CALL_EXPR_ARG (exp, 0); fp_nan = CALL_EXPR_ARG (exp, 0);
fp_inf = CALL_EXPR_ARG (exp, 1); fp_infinite = CALL_EXPR_ARG (exp, 1);
fp_normal = CALL_EXPR_ARG (exp, 2); fp_normal = CALL_EXPR_ARG (exp, 2);
fp_subnormal = CALL_EXPR_ARG (exp, 3); fp_subnormal = CALL_EXPR_ARG (exp, 3);
fp_zero = CALL_EXPR_ARG (exp, 4); fp_zero = CALL_EXPR_ARG (exp, 4);
...@@ -9778,7 +9779,7 @@ fold_builtin_fpclassify (tree exp) ...@@ -9778,7 +9779,7 @@ fold_builtin_fpclassify (tree exp)
/* fpclassify(x) -> /* fpclassify(x) ->
isnan(x) ? FP_NAN : isnan(x) ? FP_NAN :
(fabs(x) == Inf ? FP_INF : (fabs(x) == Inf ? FP_INFINITE :
(fabs(x) >= DBL_MIN ? FP_NORMAL : (fabs(x) >= DBL_MIN ? FP_NORMAL :
(x == 0 ? FP_ZERO : FP_SUBNORMAL))). */ (x == 0 ? FP_ZERO : FP_SUBNORMAL))). */
...@@ -9796,7 +9797,7 @@ fold_builtin_fpclassify (tree exp) ...@@ -9796,7 +9797,7 @@ fold_builtin_fpclassify (tree exp)
real_inf (&r); real_inf (&r);
tmp = fold_build2 (EQ_EXPR, integer_type_node, arg, tmp = fold_build2 (EQ_EXPR, integer_type_node, arg,
build_real (type, r)); build_real (type, r));
res = fold_build3 (COND_EXPR, integer_type_node, tmp, fp_inf, res); res = fold_build3 (COND_EXPR, integer_type_node, tmp, fp_infinite, res);
} }
if (HONOR_NANS (mode)) if (HONOR_NANS (mode))
......
...@@ -6567,7 +6567,7 @@ This built-in implements the C99 fpclassify functionality. The first ...@@ -6567,7 +6567,7 @@ This built-in implements the C99 fpclassify functionality. The first
five int arguments should be the target library's notion of the five int arguments should be the target library's notion of the
possible FP classes and are used for return values. They must be possible FP classes and are used for return values. They must be
constant values and they must appear in this order: @code{FP_NAN}, constant values and they must appear in this order: @code{FP_NAN},
@code{FP_INF}, @code{FP_NORMAL}, @code{FP_SUBNORMAL} and @code{FP_INFINITE}, @code{FP_NORMAL}, @code{FP_SUBNORMAL} and
@code{FP_ZERO}. The ellipsis is for exactly one floating point value @code{FP_ZERO}. The ellipsis is for exactly one floating point value
to classify. GCC treats the last argument as type-generic, which to classify. GCC treats the last argument as type-generic, which
means it does not do default promotion from float to double. means it does not do default promotion from float to double.
......
2008-05-24 Kaveh R. Ghazi <ghazi@caip.rutgers.edu>
* gcc.dg/tg-tests.h: Fix spelling of FP_INFINITE.
2008-05-23 Sandra Loosemore <sandra@codesourcery.com> 2008-05-23 Sandra Loosemore <sandra@codesourcery.com>
Daniel Jacobowitz <dan@codesourcery.com> Daniel Jacobowitz <dan@codesourcery.com>
......
/* Test various type-generic builtins by calling "main_tests()". */ /* Test various type-generic builtins by calling "main_tests()". */
#define FP_NAN 1 #define FP_NAN 1
#define FP_INF 2 #define FP_INFINITE 2
#define FP_NORMAL 3 #define FP_NORMAL 3
#define FP_SUBNORMAL 4 #define FP_SUBNORMAL 4
#define FP_ZERO 5 #define FP_ZERO 5
#define fpclassify(X) __builtin_fpclassify(FP_NAN, FP_INF, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, (X)) #define fpclassify(X) __builtin_fpclassify(FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL, FP_ZERO, (X))
void __attribute__ ((__noinline__)) void __attribute__ ((__noinline__))
foo_1 (float f, double d, long double ld, foo_1 (float f, double d, long double ld,
...@@ -118,7 +118,7 @@ main_tests (void) ...@@ -118,7 +118,7 @@ main_tests (void)
/* Test infinity. */ /* Test infinity. */
f = __builtin_inff(); d = __builtin_inf(); ld = __builtin_infl(); f = __builtin_inff(); d = __builtin_inf(); ld = __builtin_infl();
foo(f, d, ld, /*unord=*/ 0, /*isnan=*/ 0, /*isinf=*/ 1, /*isfin=*/ 0, /*isnorm=*/ 0, FP_INF); foo(f, d, ld, /*unord=*/ 0, /*isnan=*/ 0, /*isinf=*/ 1, /*isfin=*/ 0, /*isnorm=*/ 0, FP_INFINITE);
/* Test zero. */ /* Test zero. */
f = 0; d = 0; ld = 0; f = 0; d = 0; ld = 0;
...@@ -142,7 +142,7 @@ main_tests (void) ...@@ -142,7 +142,7 @@ main_tests (void)
/* Test overflow values. */ /* Test overflow values. */
f = __FLT_MAX__*2; d = __DBL_MAX__*2; ld = __LDBL_MAX__*2; f = __FLT_MAX__*2; d = __DBL_MAX__*2; ld = __LDBL_MAX__*2;
foo(f, d, ld, /*unord=*/ 0, /*isnan=*/ 0, /*isinf=*/ 1, /*isfin=*/ 0, /*isnorm=*/ 0, FP_INF); foo(f, d, ld, /*unord=*/ 0, /*isnan=*/ 0, /*isinf=*/ 1, /*isfin=*/ 0, /*isnorm=*/ 0, FP_INFINITE);
return 0; return 0;
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment