}
)
+(define_expand "isfinite<mode>2"
+ [(match_operand:SI 0 "register_operand")
+ (match_operand:GPF 1 "register_operand")]
+ "TARGET_FLOAT"
+{
+ 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 (LTU, SImode, cc_reg, const0_rtx);
+ emit_insn (gen_aarch64_cstoresi (operands[0], cmp, cc_reg));
+ DONE;
+}
+)
+
;; -------------------------------------------------------------------
;; Reload support
;; -------------------------------------------------------------------
__builtin_abort ();
}
+static void t_finf (float x, bool res)
+{
+ if (__builtin_isfinite (x) != res)
+ __builtin_abort ();
+ if (__builtin_isfinite (-x) != res)
+ __builtin_abort ();
+ if (fetestexcept (FE_INVALID))
+ __builtin_abort ();
+}
+
+static void t_fin (double x, bool res)
+{
+ if (__builtin_isfinite (x) != res)
+ __builtin_abort ();
+ if (__builtin_isfinite (-x) != res)
+ __builtin_abort ();
+ if (fetestexcept (FE_INVALID))
+ __builtin_abort ();
+}
+
int
main ()
{
t_inf (__builtin_nans (""), 0);
t_inf (__builtin_nan (""), 0);
+ t_finf (0.0f, 1);
+ t_finf (1.0f, 1);
+ t_finf (__builtin_inff (), 0);
+ t_finf (__builtin_nansf (""), 0);
+ t_finf (__builtin_nanf (""), 0);
+
+ t_fin (0.0, 1);
+ t_fin (1.0, 1);
+ t_fin (__builtin_inf (), 0);
+ t_fin (__builtin_nans (""), 0);
+ t_fin (__builtin_nan (""), 0);
+
return 0;
}