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.