Commit c541d521 by Francois-Xavier Coudert Committed by François-Xavier Coudert

trans-intrinsic.c (conv_intrinsic_ieee_is_negative): Use type generic BUILT_IN_SIGNBIT.

	* trans-intrinsic.c (conv_intrinsic_ieee_is_negative): Use type
	generic BUILT_IN_SIGNBIT.
	(conv_intrinsic_ieee_copy_sign): Likewise.
	* f95-lang.c (gfc_init_builtin_functions): Add BUILT_IN_ISINF,
	BUILT_IN_ISINF_SIGN, BUILT_IN_SIGNBIT, BUILT_IN_ISLESS,
	BUILT_IN_ISLESSGREATER, BUILT_IN_ISGREATER. Remove non-type generic
	variants of BUILT_IN_SIGNBIT.
	* mathbuiltins.def: Remove SIGNBIT.

From-SVN: r226924
parent 9f801fd7
2015-08-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org> 2015-08-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
* trans-intrinsic.c (conv_intrinsic_ieee_is_negative): Use type
generic BUILT_IN_SIGNBIT.
(conv_intrinsic_ieee_copy_sign): Likewise.
* f95-lang.c (gfc_init_builtin_functions): Add BUILT_IN_ISINF,
BUILT_IN_ISINF_SIGN, BUILT_IN_SIGNBIT, BUILT_IN_ISLESS,
BUILT_IN_ISLESSGREATER, BUILT_IN_ISGREATER. Remove non-type generic
variants of BUILT_IN_SIGNBIT.
* mathbuiltins.def: Remove SIGNBIT.
2015-08-16 Francois-Xavier Coudert <fxcoudert@gcc.gnu.org>
PR fortran/41387 PR fortran/41387
* gfortran.texi: New section "File operations on symbolic links". * gfortran.texi: New section "File operations on symbolic links".
......
...@@ -975,37 +975,38 @@ gfc_init_builtin_functions (void) ...@@ -975,37 +975,38 @@ gfc_init_builtin_functions (void)
gfc_define_builtin ("__builtin_realloc", ftype, BUILT_IN_REALLOC, gfc_define_builtin ("__builtin_realloc", ftype, BUILT_IN_REALLOC,
"realloc", ATTR_NOTHROW_LEAF_LIST); "realloc", ATTR_NOTHROW_LEAF_LIST);
/* Type-generic floating-point classification built-ins. */
ftype = build_function_type_list (integer_type_node, ftype = build_function_type_list (integer_type_node,
void_type_node, NULL_TREE); void_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_isnan", ftype, BUILT_IN_ISNAN,
"__builtin_isnan", ATTR_CONST_NOTHROW_LEAF_LIST);
gfc_define_builtin ("__builtin_isfinite", ftype, BUILT_IN_ISFINITE, gfc_define_builtin ("__builtin_isfinite", ftype, BUILT_IN_ISFINITE,
"__builtin_isfinite", ATTR_CONST_NOTHROW_LEAF_LIST); "__builtin_isfinite", ATTR_CONST_NOTHROW_LEAF_LIST);
gfc_define_builtin ("__builtin_isinf", ftype, BUILT_IN_ISINF,
"__builtin_isinf", ATTR_CONST_NOTHROW_LEAF_LIST);
gfc_define_builtin ("__builtin_isinf_sign", ftype, BUILT_IN_ISINF_SIGN,
"__builtin_isinf_sign", ATTR_CONST_NOTHROW_LEAF_LIST);
gfc_define_builtin ("__builtin_isnan", ftype, BUILT_IN_ISNAN,
"__builtin_isnan", ATTR_CONST_NOTHROW_LEAF_LIST);
gfc_define_builtin ("__builtin_isnormal", ftype, BUILT_IN_ISNORMAL, gfc_define_builtin ("__builtin_isnormal", ftype, BUILT_IN_ISNORMAL,
"__builtin_isnormal", ATTR_CONST_NOTHROW_LEAF_LIST); "__builtin_isnormal", ATTR_CONST_NOTHROW_LEAF_LIST);
gfc_define_builtin ("__builtin_signbit", ftype, BUILT_IN_SIGNBIT,
"__builtin_signbit", ATTR_CONST_NOTHROW_LEAF_LIST);
ftype = build_function_type_list (integer_type_node, void_type_node, ftype = build_function_type_list (integer_type_node, void_type_node,
void_type_node, NULL_TREE); void_type_node, NULL_TREE);
gfc_define_builtin ("__builtin_isunordered", ftype, BUILT_IN_ISUNORDERED, gfc_define_builtin ("__builtin_isless", ftype, BUILT_IN_ISLESS,
"__builtin_isunordered", ATTR_CONST_NOTHROW_LEAF_LIST); "__builtin_isless", ATTR_CONST_NOTHROW_LEAF_LIST);
gfc_define_builtin ("__builtin_islessequal", ftype, BUILT_IN_ISLESSEQUAL, gfc_define_builtin ("__builtin_islessequal", ftype, BUILT_IN_ISLESSEQUAL,
"__builtin_islessequal", ATTR_CONST_NOTHROW_LEAF_LIST); "__builtin_islessequal", ATTR_CONST_NOTHROW_LEAF_LIST);
gfc_define_builtin ("__builtin_islessgreater", ftype, BUILT_IN_ISLESSGREATER,
"__builtin_islessgreater", ATTR_CONST_NOTHROW_LEAF_LIST);
gfc_define_builtin ("__builtin_isgreater", ftype, BUILT_IN_ISGREATER,
"__builtin_isgreater", ATTR_CONST_NOTHROW_LEAF_LIST);
gfc_define_builtin ("__builtin_isgreaterequal", ftype, gfc_define_builtin ("__builtin_isgreaterequal", ftype,
BUILT_IN_ISGREATEREQUAL, "__builtin_isgreaterequal", BUILT_IN_ISGREATEREQUAL, "__builtin_isgreaterequal",
ATTR_CONST_NOTHROW_LEAF_LIST); ATTR_CONST_NOTHROW_LEAF_LIST);
gfc_define_builtin ("__builtin_isunordered", ftype, BUILT_IN_ISUNORDERED,
ftype = build_function_type_list (integer_type_node, "__builtin_isunordered", ATTR_CONST_NOTHROW_LEAF_LIST);
float_type_node, NULL_TREE);
gfc_define_builtin("__builtin_signbitf", ftype, BUILT_IN_SIGNBITF,
"signbitf", ATTR_CONST_NOTHROW_LEAF_LIST);
ftype = build_function_type_list (integer_type_node,
double_type_node, NULL_TREE);
gfc_define_builtin("__builtin_signbit", ftype, BUILT_IN_SIGNBIT,
"signbit", ATTR_CONST_NOTHROW_LEAF_LIST);
ftype = build_function_type_list (integer_type_node,
long_double_type_node, NULL_TREE);
gfc_define_builtin("__builtin_signbitl", ftype, BUILT_IN_SIGNBITL,
"signbitl", ATTR_CONST_NOTHROW_LEAF_LIST);
#define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \ #define DEF_PRIMITIVE_TYPE(ENUM, VALUE) \
......
...@@ -72,5 +72,4 @@ OTHER_BUILTIN (REMAINDER, "remainder", 2, true) ...@@ -72,5 +72,4 @@ OTHER_BUILTIN (REMAINDER, "remainder", 2, true)
OTHER_BUILTIN (RINT, "rint", 1, true) OTHER_BUILTIN (RINT, "rint", 1, true)
OTHER_BUILTIN (ROUND, "round", 1, true) OTHER_BUILTIN (ROUND, "round", 1, true)
OTHER_BUILTIN (SCALBN, "scalbn", scalbn, true) OTHER_BUILTIN (SCALBN, "scalbn", scalbn, true)
OTHER_BUILTIN (SIGNBIT, "signbit", iround, true)
OTHER_BUILTIN (TRUNC, "trunc", 1, true) OTHER_BUILTIN (TRUNC, "trunc", 1, true)
...@@ -7417,8 +7417,7 @@ conv_intrinsic_ieee_is_normal (gfc_se * se, gfc_expr * expr) ...@@ -7417,8 +7417,7 @@ conv_intrinsic_ieee_is_normal (gfc_se * se, gfc_expr * expr)
static void static void
conv_intrinsic_ieee_is_negative (gfc_se * se, gfc_expr * expr) conv_intrinsic_ieee_is_negative (gfc_se * se, gfc_expr * expr)
{ {
tree arg, signbit, isnan, decl; tree arg, signbit, isnan;
int argprec;
/* Convert arg, evaluate it only once. */ /* Convert arg, evaluate it only once. */
conv_ieee_function_args (se, expr, &arg, 1); conv_ieee_function_args (se, expr, &arg, 1);
...@@ -7429,9 +7428,9 @@ conv_intrinsic_ieee_is_negative (gfc_se * se, gfc_expr * expr) ...@@ -7429,9 +7428,9 @@ conv_intrinsic_ieee_is_negative (gfc_se * se, gfc_expr * expr)
1, arg); 1, arg);
STRIP_TYPE_NOPS (isnan); STRIP_TYPE_NOPS (isnan);
argprec = TYPE_PRECISION (TREE_TYPE (arg)); signbit = build_call_expr_loc (input_location,
decl = builtin_decl_for_precision (BUILT_IN_SIGNBIT, argprec); builtin_decl_explicit (BUILT_IN_SIGNBIT),
signbit = build_call_expr_loc (input_location, decl, 1, arg); 1, arg);
signbit = fold_build2_loc (input_location, NE_EXPR, boolean_type_node, signbit = fold_build2_loc (input_location, NE_EXPR, boolean_type_node,
signbit, integer_zero_node); signbit, integer_zero_node);
...@@ -7579,9 +7578,9 @@ conv_intrinsic_ieee_copy_sign (gfc_se * se, gfc_expr * expr) ...@@ -7579,9 +7578,9 @@ conv_intrinsic_ieee_copy_sign (gfc_se * se, gfc_expr * expr)
conv_ieee_function_args (se, expr, args, 2); conv_ieee_function_args (se, expr, args, 2);
/* Get the sign of the second argument. */ /* Get the sign of the second argument. */
argprec = TYPE_PRECISION (TREE_TYPE (args[1])); sign = build_call_expr_loc (input_location,
decl = builtin_decl_for_precision (BUILT_IN_SIGNBIT, argprec); builtin_decl_explicit (BUILT_IN_SIGNBIT),
sign = build_call_expr_loc (input_location, decl, 1, args[1]); 1, args[1]);
sign = fold_build2_loc (input_location, NE_EXPR, boolean_type_node, sign = fold_build2_loc (input_location, NE_EXPR, boolean_type_node,
sign, integer_zero_node); sign, integer_zero_node);
......
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