switch (DECL_FUNCTION_CODE (fndecl))
{
CASE_FLT_FN (BUILT_IN_ILOGB):
- errno_set = true; builtin_optab = ilogb_optab; break;
+ errno_set = true;
+ builtin_optab = ilogb_optab;
+ break;
CASE_FLT_FN (BUILT_IN_ISINF):
- builtin_optab = isinf_optab; break;
+ builtin_optab = isinf_optab;
+ break;
case BUILT_IN_ISFINITE:
builtin_optab = isfinite_optab;
break;
case BUILT_IN_ISNORMAL:
builtin_optab = isnormal_optab;
break;
+ CASE_FLT_FN (BUILT_IN_ISNAN):
+ builtin_optab = isnan_optab;
+ break;
CASE_FLT_FN (BUILT_IN_FINITE):
case BUILT_IN_FINITED32:
case BUILT_IN_FINITED64:
case BUILT_IN_ISINFD32:
case BUILT_IN_ISINFD64:
case BUILT_IN_ISINFD128:
+ case BUILT_IN_ISNAND32:
+ case BUILT_IN_ISNAND64:
+ case BUILT_IN_ISNAND128:
/* These builtins have no optabs (yet). */
break;
default:
gcc_fallthrough ();
CASE_FLT_FN (BUILT_IN_ISINF):
CASE_FLT_FN (BUILT_IN_FINITE):
+ CASE_FLT_FN (BUILT_IN_ISNAN):
case BUILT_IN_ISFINITE:
case BUILT_IN_ISNORMAL:
target = expand_builtin_interclass_mathfn (exp, target);
max_exp, min_exp);
return result;
}
+ CASE_FLT_FN (BUILT_IN_ISNAN):
+ case BUILT_IN_ISNAND32:
+ case BUILT_IN_ISNAND64:
+ case BUILT_IN_ISNAND128:
+ {
+ /* In IBM extended NaN and Inf are encoded in the high-order double
+ value only. The low-order value is not significant. */
+ if (is_ibm_extended)
+ arg = fold_build1_loc (loc, NOP_EXPR, double_type_node, arg);
+ arg = builtin_save_expr (arg);
+ tree type = TREE_TYPE (TREE_TYPE (fndecl));
+ return fold_build2_loc (loc, UNORDERED_EXPR, type, arg, arg);
+ }
default:
break;
}
return omit_one_operand_loc (loc, type, integer_one_node, arg);
if (!tree_expr_maybe_nan_p (arg))
return omit_one_operand_loc (loc, type, integer_zero_node, arg);
-
- {
- bool is_ibm_extended = MODE_COMPOSITE_P (TYPE_MODE (TREE_TYPE (arg)));
- if (is_ibm_extended)
- {
- /* NaN and Inf are encoded in the high-order double value
- only. The low-order value is not significant. */
- arg = fold_build1_loc (loc, NOP_EXPR, double_type_node, arg);
- }
- }
- arg = builtin_save_expr (arg);
- return fold_build2_loc (loc, UNORDERED_EXPR, type, arg, arg);
+ return NULL_TREE;
case BUILT_IN_ISSIGNALING:
/* Folding to true for REAL_CST is done in fold_const_call_ss.
case BUILT_IN_ISNAND32:
case BUILT_IN_ISNAND64:
case BUILT_IN_ISNAND128:
- return fold_builtin_classify (loc, fndecl, arg0, BUILT_IN_ISNAN);
+ {
+ tree ret = fold_builtin_classify (loc, fndecl, arg0, BUILT_IN_ISNAN);
+ if (ret)
+ return ret;
+ return fold_builtin_interclass_mathfn (loc, fndecl, arg0);
+ }
case BUILT_IN_ISSIGNALING:
return fold_builtin_classify (loc, fndecl, arg0, BUILT_IN_ISSIGNALING);
otherwise. @var{m} is a scalar floating point mode. Operand 0
has mode @code{SImode}, and operand 1 has mode @var{m}.
+@cindex @code{isnan@var{m}2} instruction pattern
+@item @samp{isnan@var{m}2}
+Return 1 if operand 1 is a @code{NaN} and 0 otherwise.
+@var{m} is a scalar floating point mode. Operand 0
+has mode @code{SImode}, and operand 1 has mode @var{m}.
+
@cindex @code{isnormal@var{m}2} instruction pattern
@item @samp{isnormal@var{m}2}
Return 1 if operand 1 is a normal floating point number and 0