[Bug middle-end/90323] powerpc should convert equivalent sequences to vec_sel()

luoxhu at gcc dot gnu.org gcc-bugzilla@gcc.gnu.org
Fri Apr 30 02:20:57 GMT 2021


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90323

--- Comment #16 from luoxhu at gcc dot gnu.org ---

> +2016-11-09  Segher Boessenkool  <segher@kernel.crashing.org>
> +
> +       * 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) A) to (ior (and A ~C) (and B C)) if C
> +       is a const_int.


Is it a MUST that C be const here? For this case in PR90323, C is not a const 
actually.

    l = l & ~mask;
    l |= mask & r;

Trying 8, 9 -> 10:
    8: r127:V4SI=r124:V4SI^r131:V4SI
      REG_DEAD r131:V4SI
    9: r122:V4SI=r127:V4SI&r130:V4SI
      REG_DEAD r130:V4SI
      REG_DEAD r127:V4SI
   10: r128:V4SI=r124:V4SI^r122:V4SI
      REG_DEAD r124:V4SI
      REG_DEAD r122:V4SI


More information about the Gcc-bugs mailing list