On Tue, Jun 11, 2024 at 10:40:01PM +0800, liuhongt wrote: > gcc/ChangeLog: > > PR target/115384 > * simplify-rtx.cc (simplify_context::simplify_binary_operation_1): > Only do the simplification of (AND (ASHIFTRT A imm) mask) > to (LSHIFTRT A imm) when the component of const_vector is > CONST_INT_P. > > gcc/testsuite/ChangeLog: > > * gcc.target/i386/pr115384.c: New test.
LGTM, except > --- /dev/null > +++ b/gcc/testsuite/gcc.target/i386/pr115384.c > @@ -0,0 +1,12 @@ > +/* { dg-do compile { target { ! ia32 } } } */ Maybe just int128 target instead of { ! ia32 } would be more appropriate. Ok either way. > +/* { dg-options "-O" } */ > + > +typedef __attribute__((__vector_size__(sizeof(__int128)))) __int128 W; > + > +W w; > + > +void > +foo() > +{ > + w = w >> 4 & 18446744073709551600llu; > +} Jakub