simplify-rtx.c (simplify_binary_operation_1): Handle more cases for the "(and X (ior (not X) Y) -> (and X Y)" transform.
* simplify-rtx.c (simplify_binary_operation_1): Handle more cases for the "(and X (ior (not X) Y) -> (and X Y)" transform. From-SVN: r219217
This commit is contained in:
parent
2f48c66c9d
commit
31dd2a8669
@ -1,3 +1,8 @@
|
||||
2015-01-05 Segher Boessenkool <segher@kernel.crashing.org>
|
||||
|
||||
* simplify-rtx.c (simplify_binary_operation_1): Handle more cases
|
||||
for the "(and X (ior (not X) Y) -> (and X Y)" transform.
|
||||
|
||||
2015-01-05 Segher Boessenkool <segher@kernel.crashing.org>
|
||||
|
||||
* combine.c (combine_validate_cost): Do not count the cost of a
|
||||
|
@ -2933,15 +2933,27 @@ simplify_binary_operation_1 (enum rtx_code code, machine_mode mode,
|
||||
/* (and X (ior (not X) Y) -> (and X Y) */
|
||||
if (GET_CODE (op1) == IOR
|
||||
&& GET_CODE (XEXP (op1, 0)) == NOT
|
||||
&& op0 == XEXP (XEXP (op1, 0), 0))
|
||||
&& rtx_equal_p (op0, XEXP (XEXP (op1, 0), 0)))
|
||||
return simplify_gen_binary (AND, mode, op0, XEXP (op1, 1));
|
||||
|
||||
/* (and (ior (not X) Y) X) -> (and X Y) */
|
||||
if (GET_CODE (op0) == IOR
|
||||
&& GET_CODE (XEXP (op0, 0)) == NOT
|
||||
&& op1 == XEXP (XEXP (op0, 0), 0))
|
||||
&& rtx_equal_p (op1, XEXP (XEXP (op0, 0), 0)))
|
||||
return simplify_gen_binary (AND, mode, op1, XEXP (op0, 1));
|
||||
|
||||
/* (and X (ior Y (not X)) -> (and X Y) */
|
||||
if (GET_CODE (op1) == IOR
|
||||
&& GET_CODE (XEXP (op1, 1)) == NOT
|
||||
&& rtx_equal_p (op0, XEXP (XEXP (op1, 1), 0)))
|
||||
return simplify_gen_binary (AND, mode, op0, XEXP (op1, 0));
|
||||
|
||||
/* (and (ior Y (not X)) X) -> (and X Y) */
|
||||
if (GET_CODE (op0) == IOR
|
||||
&& GET_CODE (XEXP (op0, 1)) == NOT
|
||||
&& rtx_equal_p (op1, XEXP (XEXP (op0, 1), 0)))
|
||||
return simplify_gen_binary (AND, mode, op1, XEXP (op0, 0));
|
||||
|
||||
tem = simplify_byte_swapping_operation (code, mode, op0, op1);
|
||||
if (tem)
|
||||
return tem;
|
||||
|
Loading…
Reference in New Issue
Block a user