(simplify_binary_operation): Do (x - (x & y)) -> (x & ~y).

From-SVN: r8494
This commit is contained in:
Torbjorn Granlund 1994-11-17 23:31:20 +00:00
parent b76f773b54
commit 29d72c4b69
1 changed files with 9 additions and 0 deletions

View File

@ -3718,6 +3718,15 @@ simplify_binary_operation (code, mode, op0, op1)
/* Don't let a relocatable value get a negative coeff. */
if (GET_CODE (op1) == CONST_INT && GET_MODE (op0) != VOIDmode)
return plus_constant (op0, - INTVAL (op1));
/* (x - (x & y)) -> (x & ~y) */
if (GET_CODE (op1) == AND)
{
if (rtx_equal_p (op0, XEXP (op1, 0)))
return cse_gen_binary (AND, mode, op0, gen_rtx (NOT, mode, XEXP (op1, 1)));
if (rtx_equal_p (op0, XEXP (op1, 1)))
return cse_gen_binary (AND, mode, op0, gen_rtx (NOT, mode, XEXP (op1, 0)));
}
break;
case MULT: