On Tue, May 25, 2021 at 2:11 PM Andrew Pinski <pins...@gmail.com> wrote: > > On Mon, May 24, 2021 at 11:03 PM Hongtao Liu via Gcc-patches > <gcc-patches@gcc.gnu.org> wrote: > > > > Hi: > > This patch is about to do transformation like below. > > Bootstrapped and regtested on x86_64-linux-gnu{-m32,}. > > Ok for trunk? > > > > from > > notl %edi > > vpbroadcastd %edi, %xmm0 > > vpand %xmm1, %xmm0, %xmm0 > > to > > vpbroadcastd %edi, %xmm0 > > vpandn %xmm1, %xmm0, %xmm0 > > > > gcc/ChangeLog: > > > > PR target/100711 > > * config/i386/sse.md (*andnot<mode>3): New combine splitter > > after it. > > > > gcc/testsuite/ChangeLog: > > > > PR target/100711 > > * gcc.target/i386/avx2-pr100711.c: New test. > > * gcc.target/i386/avx512bw-pr100711.c: New test. > > > > > Does it make sense to make this more generic and have combine/simplify > rtx instead try: > (vec_dup (not)) to (not (vec_dup))
Even w/ that, a combine splitter is still needed since we don't have any pandn patterns which contain op1 as vec_duplicate or "not" pattern for vector mode, generic simplification only helps combine/forprop to match more possibilities, but not split pattern by itself. > > Thanks, > Andrew Pinski -- BR, Hongtao