Commit f6d53468 by Ulrich Weigand Committed by Ulrich Weigand

f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_HUGE_VAL family of…

f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_HUGE_VAL family of intrinsics instead of BUILT_IN_INF family.

	* f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_HUGE_VAL
	family of intrinsics instead of BUILT_IN_INF family.
	* trans-intrinsics.c (gfc_conv_intrinsic_nearest): Use
	BUILT_IN_HUGE_VAL instead of BUILT_IN_INF.

From-SVN: r145307
parent 4c936d4f
2009-03-30 Ulrich Weigand <Ulrich.Weigand@de.ibm.com>
* f95-lang.c (gfc_init_builtin_functions): Define BUILT_IN_HUGE_VAL
family of intrinsics instead of BUILT_IN_INF family.
* trans-intrinsics.c (gfc_conv_intrinsic_nearest): Use
BUILT_IN_HUGE_VAL instead of BUILT_IN_INF.
2009-03-30 Jakub Jelinek <jakub@redhat.com> 2009-03-30 Jakub Jelinek <jakub@redhat.com>
* trans-types.c (gfc_sym_type, gfc_return_by_reference): For * trans-types.c (gfc_sym_type, gfc_return_by_reference): For
......
...@@ -917,12 +917,12 @@ gfc_init_builtin_functions (void) ...@@ -917,12 +917,12 @@ gfc_init_builtin_functions (void)
gfc_define_builtin ("__builtin_fmodf", mfunc_float[1], gfc_define_builtin ("__builtin_fmodf", mfunc_float[1],
BUILT_IN_FMODF, "fmodf", true); BUILT_IN_FMODF, "fmodf", true);
gfc_define_builtin ("__builtin_infl", mfunc_longdouble[3], gfc_define_builtin ("__builtin_huge_vall", mfunc_longdouble[3],
BUILT_IN_INFL, "__builtin_infl", true); BUILT_IN_HUGE_VALL, "__builtin_huge_vall", true);
gfc_define_builtin ("__builtin_inf", mfunc_double[3], gfc_define_builtin ("__builtin_huge_val", mfunc_double[3],
BUILT_IN_INF, "__builtin_inf", true); BUILT_IN_HUGE_VAL, "__builtin_huge_val", true);
gfc_define_builtin ("__builtin_inff", mfunc_float[3], gfc_define_builtin ("__builtin_huge_valf", mfunc_float[3],
BUILT_IN_INFF, "__builtin_inff", true); BUILT_IN_HUGE_VALF, "__builtin_huge_valf", true);
/* lround{f,,l} and llround{f,,l} */ /* lround{f,,l} and llround{f,,l} */
type = tree_cons (NULL_TREE, float_type_node, void_list_node); type = tree_cons (NULL_TREE, float_type_node, void_list_node);
......
...@@ -3130,32 +3130,32 @@ gfc_conv_intrinsic_fraction (gfc_se * se, gfc_expr * expr) ...@@ -3130,32 +3130,32 @@ gfc_conv_intrinsic_fraction (gfc_se * se, gfc_expr * expr)
/* NEAREST (s, dir) is translated into /* NEAREST (s, dir) is translated into
tmp = copysign (INF, dir); tmp = copysign (HUGE_VAL, dir);
return nextafter (s, tmp); return nextafter (s, tmp);
*/ */
static void static void
gfc_conv_intrinsic_nearest (gfc_se * se, gfc_expr * expr) gfc_conv_intrinsic_nearest (gfc_se * se, gfc_expr * expr)
{ {
tree args[2], type, tmp; tree args[2], type, tmp;
int nextafter, copysign, inf; int nextafter, copysign, huge_val;
switch (expr->ts.kind) switch (expr->ts.kind)
{ {
case 4: case 4:
nextafter = BUILT_IN_NEXTAFTERF; nextafter = BUILT_IN_NEXTAFTERF;
copysign = BUILT_IN_COPYSIGNF; copysign = BUILT_IN_COPYSIGNF;
inf = BUILT_IN_INFF; huge_val = BUILT_IN_HUGE_VALF;
break; break;
case 8: case 8:
nextafter = BUILT_IN_NEXTAFTER; nextafter = BUILT_IN_NEXTAFTER;
copysign = BUILT_IN_COPYSIGN; copysign = BUILT_IN_COPYSIGN;
inf = BUILT_IN_INF; huge_val = BUILT_IN_HUGE_VAL;
break; break;
case 10: case 10:
case 16: case 16:
nextafter = BUILT_IN_NEXTAFTERL; nextafter = BUILT_IN_NEXTAFTERL;
copysign = BUILT_IN_COPYSIGNL; copysign = BUILT_IN_COPYSIGNL;
inf = BUILT_IN_INFL; huge_val = BUILT_IN_HUGE_VALL;
break; break;
default: default:
gcc_unreachable (); gcc_unreachable ();
...@@ -3164,7 +3164,7 @@ gfc_conv_intrinsic_nearest (gfc_se * se, gfc_expr * expr) ...@@ -3164,7 +3164,7 @@ gfc_conv_intrinsic_nearest (gfc_se * se, gfc_expr * expr)
type = gfc_typenode_for_spec (&expr->ts); type = gfc_typenode_for_spec (&expr->ts);
gfc_conv_intrinsic_function_args (se, expr, args, 2); gfc_conv_intrinsic_function_args (se, expr, args, 2);
tmp = build_call_expr (built_in_decls[copysign], 2, tmp = build_call_expr (built_in_decls[copysign], 2,
build_call_expr (built_in_decls[inf], 0), build_call_expr (built_in_decls[huge_val], 0),
fold_convert (type, args[1])); fold_convert (type, args[1]));
se->expr = build_call_expr (built_in_decls[nextafter], 2, se->expr = build_call_expr (built_in_decls[nextafter], 2,
fold_convert (type, args[0]), tmp); fold_convert (type, args[0]), tmp);
......
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