Commit 52a75c3c by Richard Henderson

simplify-rtx.c (simplify_relational_operation): Canonicalize constant to op1 for testing.

        * simplify-rtx.c (simplify_relational_operation): Canonicalize
        constant to op1 for testing.

From-SVN: r31825
parent b027470f
2000-02-06 Richard Henderson <rth@cygnus.com>
* simplify-rtx.c (simplify_relational_operation): Canonicalize
constant to op1 for testing.
2000-02-06 Michael Hayes <m.hayes@elec.canterbury.ac.nz> 2000-02-06 Michael Hayes <m.hayes@elec.canterbury.ac.nz>
* config/c4x/c4x.md (*ldi_on_overflow): New pattern. * config/c4x/c4x.md (*ldi_on_overflow): New pattern.
...@@ -171,20 +176,20 @@ ...@@ -171,20 +176,20 @@
2000-02-04 Jan Hubicka <jh@suse.cz> 2000-02-04 Jan Hubicka <jh@suse.cz>
Richard Henderson <rth@cygnus.com> Richard Henderson <rth@cygnus.com>
* i386.c (SAVE_REGS_FIRST): Remove. * i386.c (SAVE_REGS_FIRST): Remove.
(ix86_initial_elimination_offset): Handle only SAVE_REGS_FIRST mode. (ix86_initial_elimination_offset): Handle only SAVE_REGS_FIRST mode.
(ix86_compute_frame_size): Likewise. (ix86_compute_frame_size): Likewise.
(ix86_expand_prologue): Likewise. Use pro_epilogue_adjust_stack. (ix86_expand_prologue): Likewise. Use pro_epilogue_adjust_stack.
(ix86_emit_restore_regs): Remove. (ix86_emit_restore_regs): Remove.
(ix86_emit_epilogue_esp_adjustment): Use pro_epilogue_adjust_stack (ix86_emit_epilogue_esp_adjustment): Use pro_epilogue_adjust_stack
when a frame pointer is in use. when a frame pointer is in use.
(ix86_expand_epilogue): Handle only SAVE_REGS_FIRST mode. Use mov (ix86_expand_epilogue): Handle only SAVE_REGS_FIRST mode. Use mov
instead of pop to restore a register when profitable; emit leave instead of pop to restore a register when profitable; emit leave
when profitable. when profitable.
(ix86_attr_length_default): Handle pro_epilogue_adjust_stack (ix86_attr_length_default): Handle pro_epilogue_adjust_stack
as a TYPE_LEA insn. as a TYPE_LEA insn.
(ix86_adjust_cost): Handle pro_epilogue_adjust_stack as TYPE_ALU. (ix86_adjust_cost): Handle pro_epilogue_adjust_stack as TYPE_ALU.
* i386.md (prologue_allocate_stack): Remove. * i386.md (prologue_allocate_stack): Remove.
(epilogue_deallocate_stack): Remove. (epilogue_deallocate_stack): Remove.
(pro_epilogue_adjust_stack): New. (pro_epilogue_adjust_stack): New.
......
...@@ -1591,6 +1591,14 @@ simplify_relational_operation (code, mode, op0, op1) ...@@ -1591,6 +1591,14 @@ simplify_relational_operation (code, mode, op0, op1)
) )
return 0; return 0;
/* Make sure the constant is second. */
if ((CONSTANT_P (op0) && ! CONSTANT_P (op1))
|| (GET_CODE (op0) == CONST_INT && GET_CODE (op1) != CONST_INT))
{
tem = op0, op0 = op1, op1 = tem;
code = swap_condition (code);
}
/* For integer comparisons of A and B maybe we can simplify A - B and can /* For integer comparisons of A and B maybe we can simplify A - B and can
then simplify a comparison of that with zero. If A and B are both either then simplify a comparison of that with zero. If A and B are both either
a register or a CONST_INT, this can't help; testing for these cases will a register or a CONST_INT, this can't help; testing for these cases will
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment