* combine.c (combine_simplify_rtx): Give FLOAT_STORE_FLAG_VALUE a mode.
* cse.c (find_comparison_args, fold_rtx): Likewise.
* integrate.c (subst_constants): Likewise.
* loop.c (get_condition): Likewise.
* tm.texi (FLOAT_STORE_FLAG_VALUE): Update docs.
* alpha.h (FLOAT_STORE_FLAG_VALUE): Use REAL_VALUE_ATOF.
From-SVN: r31479
+2000-01-17 Richard Henderson <rth@cygnus.com>
+
+ * combine.c (combine_simplify_rtx): Give FLOAT_STORE_FLAG_VALUE a mode.
+ * cse.c (find_comparison_args, fold_rtx): Likewise.
+ * integrate.c (subst_constants): Likewise.
+ * loop.c (get_condition): Likewise.
+
+ * tm.texi (FLOAT_STORE_FLAG_VALUE): Update docs.
+
+ * alpha.h (FLOAT_STORE_FLAG_VALUE): Use REAL_VALUE_ATOF.
+
2000-01-18 Martin v. Löwis <loewis@informatik.hu-berlin.de>
* c-parse.in (SAVE_WARN_FLAGS): Create an INTEGER_CST.
temp = simplify_relational_operation (code, op0_mode,
XEXP (x, 0), XEXP (x, 1));
#ifdef FLOAT_STORE_FLAG_VALUE
- if (temp != 0 && GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
- temp = ((temp == const0_rtx) ? CONST0_RTX (GET_MODE (x))
- : immed_real_const_1 (FLOAT_STORE_FLAG_VALUE, GET_MODE (x)));
+ if (temp != 0 && GET_MODE_CLASS (mode) == MODE_FLOAT)
+ {
+ if (temp == const0_rtx)
+ temp = CONST0_RTX (mode);
+ else
+ temp = immed_real_const_1 (FLOAT_STORE_FLAG_VALUE (mode), mode);
+ }
#endif
break;
case 'c':
/* Define the value returned by a floating-point comparison instruction. */
-#define FLOAT_STORE_FLAG_VALUE (TARGET_FLOAT_VAX ? 0.5 : 2.0)
+#define FLOAT_STORE_FLAG_VALUE(MODE) \
+ REAL_VALUE_ATOF ((TARGET_FLOAT_VAX ? "0.5" : "2.0"), (MODE))
/* Canonicalize a comparison from one we don't have to one we do have. */
&& code == LT && STORE_FLAG_VALUE == -1)
#ifdef FLOAT_STORE_FLAG_VALUE
|| (GET_MODE_CLASS (GET_MODE (arg1)) == MODE_FLOAT
- && FLOAT_STORE_FLAG_VALUE < 0)
+ && (REAL_VALUE_NEGATIVE
+ (FLOAT_STORE_FLAG_VALUE (GET_MODE (arg1)))))
#endif
)
x = arg1;
&& code == GE && STORE_FLAG_VALUE == -1)
#ifdef FLOAT_STORE_FLAG_VALUE
|| (GET_MODE_CLASS (GET_MODE (arg1)) == MODE_FLOAT
- && FLOAT_STORE_FLAG_VALUE < 0)
+ && (REAL_VALUE_NEGATIVE
+ (FLOAT_STORE_FLAG_VALUE (GET_MODE (arg1)))))
#endif
)
x = arg1, reverse_code = 1;
#ifdef FLOAT_STORE_FLAG_VALUE
|| (code == LT
&& GET_MODE_CLASS (inner_mode) == MODE_FLOAT
- && FLOAT_STORE_FLAG_VALUE < 0)
+ && (REAL_VALUE_NEGATIVE
+ (FLOAT_STORE_FLAG_VALUE (GET_MODE (arg1)))))
#endif
)
&& GET_RTX_CLASS (GET_CODE (p->exp)) == '<'))
#ifdef FLOAT_STORE_FLAG_VALUE
|| (code == GE
&& GET_MODE_CLASS (inner_mode) == MODE_FLOAT
- && FLOAT_STORE_FLAG_VALUE < 0)
+ && (REAL_VALUE_NEGATIVE
+ (FLOAT_STORE_FLAG_VALUE (GET_MODE (arg1)))))
#endif
)
&& GET_RTX_CLASS (GET_CODE (p->exp)) == '<')
#ifdef FLOAT_STORE_FLAG_VALUE
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
- true = CONST_DOUBLE_FROM_REAL_VALUE (FLOAT_STORE_FLAG_VALUE,
- mode);
+ true = (CONST_DOUBLE_FROM_REAL_VALUE
+ (FLOAT_STORE_FLAG_VALUE (mode), mode));
false = CONST0_RTX (mode);
}
#endif
#ifdef FLOAT_STORE_FLAG_VALUE
if (GET_MODE_CLASS (mode) == MODE_FLOAT)
{
- true = CONST_DOUBLE_FROM_REAL_VALUE (FLOAT_STORE_FLAG_VALUE,
- mode);
+ true = (CONST_DOUBLE_FROM_REAL_VALUE
+ (FLOAT_STORE_FLAG_VALUE (mode), mode));
false = CONST0_RTX (mode);
}
#endif
const_arg1 ? const_arg1 : folded_arg1);
#ifdef FLOAT_STORE_FLAG_VALUE
if (new != 0 && GET_MODE_CLASS (mode) == MODE_FLOAT)
- new = ((new == const0_rtx) ? CONST0_RTX (mode)
- : CONST_DOUBLE_FROM_REAL_VALUE (FLOAT_STORE_FLAG_VALUE, mode));
+ {
+ if (new == const0_rtx)
+ new = CONST0_RTX (mode);
+ else
+ new = (CONST_DOUBLE_FROM_REAL_VALUE
+ (FLOAT_STORE_FLAG_VALUE (mode), mode));
+ }
#endif
break;
XEXP (x, 0), XEXP (x, 1));
#ifdef FLOAT_STORE_FLAG_VALUE
if (new != 0 && GET_MODE_CLASS (GET_MODE (x)) == MODE_FLOAT)
- new = ((new == const0_rtx) ? CONST0_RTX (GET_MODE (x))
- : CONST_DOUBLE_FROM_REAL_VALUE (FLOAT_STORE_FLAG_VALUE,
- GET_MODE (x)));
+ {
+ enum machine_mode mode = GET_MODE (x);
+ if (new == const0_rtx)
+ new = CONST0_RTX (mode);
+ else
+ {
+ REAL_VALUE_TYPE val = FLOAT_STORE_FLAG_VALUE (mode);
+ new = CONST_DOUBLE_FROM_REAL_VALUE (val, mode);
+ }
+ }
#endif
break;
}
#ifdef FLOAT_STORE_FLAG_VALUE
|| (code == LT
&& GET_MODE_CLASS (inner_mode) == MODE_FLOAT
- && FLOAT_STORE_FLAG_VALUE < 0)
+ && (REAL_VALUE_NEGATIVE
+ (FLOAT_STORE_FLAG_VALUE (inner_mode))))
#endif
))
&& GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<'))
#ifdef FLOAT_STORE_FLAG_VALUE
|| (code == GE
&& GET_MODE_CLASS (inner_mode) == MODE_FLOAT
- && FLOAT_STORE_FLAG_VALUE < 0)
+ && (REAL_VALUE_NEGATIVE
+ (FLOAT_STORE_FLAG_VALUE (inner_mode))))
#endif
))
&& GET_RTX_CLASS (GET_CODE (SET_SRC (set))) == '<'
instructions.
@findex FLOAT_STORE_FLAG_VALUE
-@item FLOAT_STORE_FLAG_VALUE
-A C expression that gives a non-zero floating point value that is
+@item FLOAT_STORE_FLAG_VALUE (@var{mode})
+A C expression that gives a non-zero @code{REAL_VALUE_TYPE} value that is
returned when comparison operators with floating-point results are true.
Define this macro on machine that have comparison operations that return
floating-point values. If there are no such operations, do not define