middle-end: Optimize (A&C)^(B&C) to (A^B)&C in simplify_rtx (take 3).
authorRoger Sayle <roger@nextmovesoftware.com>
Mon, 29 Jun 2020 16:33:23 +0000 (17:33 +0100)
committerRoger Sayle <roger@nextmovesoftware.com>
Mon, 29 Jun 2020 16:37:51 +0000 (17:37 +0100)
commit346bce6fe0cf1ed5f6a7ad732d2361d77b203c87
tree72d205ac4385f305e7d5b52f1185c33c5025389e
parent54980635c537f3130481da2d8b1109c775db8bb0
middle-end: Optimize (A&C)^(B&C) to (A^B)&C in simplify_rtx (take 3).

2020-06-29  Roger Sayle  <roger@nextmovesoftware.com>
gcc/ChangeLog:
* simplify-rtx.c (simplify_distributive_operation): New function
to un-distribute a binary operation of two binary operations.
(X & C) ^ (Y & C) to (X ^ Y) & C, when C is simple (i.e. a constant).
(simplify_binary_operation_1) <IOR, XOR, AND>: Call it from here
when appropriate.
(test_scalar_int_ops): New function for unit self-testing
scalar integer transformations in simplify-rtx.c.
(test_scalar_ops): Call test_scalar_int_ops for each integer mode.
(simplify_rtx_c_tests): Call test_scalar_ops.
gcc/simplify-rtx.c