+2009-04-07 Paolo Bonzini <bonzini@gnu.org>
+
+ * config/i386/i386.c (ix86_compare_emitted): Remove.
+ (ix86_expand_compare, ix86_expand_branch): Handle MODE_CC
+ ix86_compare_op0 like ix86_compare_emitted used to be handled.
+ * config/i386/i386.h (ix86_compare_emitted): Remove.
+ * config/i386/i386.md (stack_protect_test): Set ix86_compare_op0
+ instead of ix86_compare_emitted.
+ * config/i386/sync.md (sync_compare_and_swap_cc): Likewise.
+
2009-04-07 Andrew Stubbs <ams@codesourcery.com>
* config.gcc (sh-*-*): Add sysroot-suffix.h to tm_file.
rtx ix86_compare_op0 = NULL_RTX;
rtx ix86_compare_op1 = NULL_RTX;
-rtx ix86_compare_emitted = NULL_RTX;
/* Define parameter passing and return registers. */
if (bypass_test)
*bypass_test = NULL_RTX;
- if (ix86_compare_emitted)
- {
- ret = gen_rtx_fmt_ee (code, VOIDmode, ix86_compare_emitted, const0_rtx);
- ix86_compare_emitted = NULL_RTX;
- }
+ if (GET_MODE_CLASS (GET_MODE (ix86_compare_op0)) == MODE_CC)
+ ret = gen_rtx_fmt_ee (code, VOIDmode, ix86_compare_op0, ix86_compare_op1);
+
else if (SCALAR_FLOAT_MODE_P (GET_MODE (op0)))
{
gcc_assert (!DECIMAL_FLOAT_MODE_P (GET_MODE (op0)));
{
rtx tmp;
- /* If we have emitted a compare insn, go straight to simple.
- ix86_expand_compare won't emit anything if ix86_compare_emitted
- is non NULL. */
- if (ix86_compare_emitted)
- goto simple;
-
switch (GET_MODE (ix86_compare_op0))
{
case QImode:
}
default:
- gcc_unreachable ();
+ /* If we have already emitted a compare insn, go straight to simple.
+ ix86_expand_compare won't emit anything if ix86_compare_emitted
+ is non NULL. */
+ gcc_assert (GET_MODE_CLASS (GET_MODE (ix86_compare_op0)) == MODE_CC);
+ goto simple;
}
}
extern rtx ix86_compare_op0; /* operand 0 for comparisons */
extern rtx ix86_compare_op1; /* operand 1 for comparisons */
-extern rtx ix86_compare_emitted;
\f
/* To properly truncate FP values into integers, we need to set i387 control
word. We can't emit proper mode switching code before reload, as spills
""
{
rtx flags = gen_rtx_REG (CCZmode, FLAGS_REG);
- ix86_compare_op0 = operands[0];
- ix86_compare_op1 = operands[1];
- ix86_compare_emitted = flags;
#ifdef TARGET_THREAD_SSP_OFFSET
if (TARGET_64BIT)
else
emit_insn (gen_stack_protect_test_si (flags, operands[0], operands[1]));
#endif
+
+ ix86_compare_op0 = flags;
+ ix86_compare_op1 = const0_rtx;
emit_jump_insn (gen_beq (operands[2]));
DONE;
})
"TARGET_CMPXCHG"
{
operands[4] = gen_rtx_REG (CCZmode, FLAGS_REG);
- ix86_compare_op0 = operands[3];
- ix86_compare_op1 = NULL;
- ix86_compare_emitted = operands[4];
+ ix86_compare_op0 = operands[4];
+ ix86_compare_op1 = const0_rtx;
if ((<MODE>mode == DImode && !TARGET_64BIT) || <MODE>mode == TImode)
{
enum machine_mode hmode = <MODE>mode == DImode ? SImode : DImode;