On 11/09/2016 10:13 PM, Segher Boessenkool wrote:
        * simplify-rtx.c (simplify_binary_operation_1): Simplify
        (xor (and (xor A B) C) B) to (ior (and A C) (and B ~C)) and
        (xor (and (xor A B) C) B) to (ior (and A ~C) (and B C)) if C
        is a const_int.

I think one of the xors should have A as the second operand.


+    /* If we have (xor (and (xor A B) C) A) with C a constant we can instead
+       do (ior (and A ~C) (and B C)) which is a machine instruction on some
+       machines, and also has shorter instruction path length.  */
+      if (GET_CODE (op0) == AND

Comments doesn't line up with the if/else on my monitor; could be email damage but please check.

Other than that, I think it does qualify as a simplification (or at least an improvement), so OK. Would be nice to check for it with a testcase.


Bernd

Reply via email to