Commit 3aceff0d by Richard Kenner

(force_to_mode, case NE): Fix typo and logical error.

(simplify_comparison): Don't swap args if op1 is CONST_INT.

From-SVN: r12339
parent f8fe20b2
...@@ -6231,9 +6231,10 @@ force_to_mode (x, mode, mask, reg, just_select) ...@@ -6231,9 +6231,10 @@ force_to_mode (x, mode, mask, reg, just_select)
case NE: case NE:
/* (and (ne FOO 0) CONST) can be (and FOO CONST) if CONST is included /* (and (ne FOO 0) CONST) can be (and FOO CONST) if CONST is included
in STORE_FLAG_VALUE and FOO has no bits that might be nonzero not in STORE_FLAG_VALUE and FOO has a single bit that might be nonzero,
in CONST. */ which is in CONST. */
if ((mask & ~ STORE_FLAG_VALUE) == 0 && XEXP (x, 0) == const0_rtx if ((mask & ~ STORE_FLAG_VALUE) == 0 && XEXP (x, 1) == const0_rtx
&& exact_log2 (nonzero_bits (XEXP (x, 0), mode)) >= 0
&& (nonzero_bits (XEXP (x, 0), mode) & ~ mask) == 0) && (nonzero_bits (XEXP (x, 0), mode) & ~ mask) == 0)
return force_to_mode (XEXP (x, 0), mode, mask, reg, next_select); return force_to_mode (XEXP (x, 0), mode, mask, reg, next_select);
...@@ -8992,8 +8993,9 @@ simplify_comparison (code, pop0, pop1) ...@@ -8992,8 +8993,9 @@ simplify_comparison (code, pop0, pop1)
} }
/* If the first operand is a constant, swap the operands and adjust the /* If the first operand is a constant, swap the operands and adjust the
comparison code appropriately. */ comparison code appropriately, but don't do this if the second operand
if (CONSTANT_P (op0)) is already a constant integer. */
if (CONSTANT_P (op0) && GET_CODE (op1) != CONST_INT)
{ {
tem = op0, op0 = op1, op1 = tem; tem = op0, op0 = op1, op1 = tem;
code = swap_condition (code); code = swap_condition (code);
......
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