}
)
+(define_expand "isnan<mode>2"
+ [(match_operand:SI 0 "register_operand")
+ (match_operand:GPF 1 "register_operand")]
+ "TARGET_FLOAT && flag_signaling_nans"
+{
+ rtx op = force_lowpart_subreg (<V_INT_EQUIV>mode, operands[1], <MODE>mode);
+ rtx tmp = gen_reg_rtx (<V_INT_EQUIV>mode);
+ emit_move_insn (tmp, GEN_INT (HOST_WIDE_INT_M1U << (<mantissa_bits> + 1)));
+ rtx cc_reg = gen_rtx_REG (CC_SWPmode, CC_REGNUM);
+ emit_insn (gen_cmp_swp_lsl_reg<v_int_equiv> (op, GEN_INT (1), tmp));
+ rtx cmp = gen_rtx_fmt_ee (GTU, SImode, cc_reg, const0_rtx);
+ emit_insn (gen_aarch64_cstoresi (operands[0], cmp, cc_reg));
+ DONE;
+}
+)
+
;; -------------------------------------------------------------------
;; Reload support
;; -------------------------------------------------------------------
__builtin_abort ();
}
+static void t_nanf (float x, bool res)
+{
+ if (__builtin_isnan (x) != res)
+ __builtin_abort ();
+ if (__builtin_isnan (-x) != res)
+ __builtin_abort ();
+ if (fetestexcept (FE_INVALID))
+ __builtin_abort ();
+}
+
+static void t_nan (double x, bool res)
+{
+ if (__builtin_isnan (x) != res)
+ __builtin_abort ();
+ if (__builtin_isnan (-x) != res)
+ __builtin_abort ();
+ if (fetestexcept (FE_INVALID))
+ __builtin_abort ();
+}
+
+
int
main ()
{
t_fin (__builtin_nans (""), 0);
t_fin (__builtin_nan (""), 0);
+ t_nanf (0.0f, 0);
+ t_nanf (1.0f, 0);
+ t_nanf (__builtin_inff (), 0);
+ t_nanf (__builtin_nansf (""), 1);
+ t_nanf (__builtin_nanf (""), 1);
+
+ t_nan (0.0, 0);
+ t_nan (1.0, 0);
+ t_nan (__builtin_inf (), 0);
+ t_nan (__builtin_nans (""), 1);
+ t_nan (__builtin_nan (""), 1);
+
return 0;
}