i386: Optimize pmovmskb on inverted vector to inversion of pmovmskb result [PR98461]
authorJakub Jelinek <jakub@redhat.com>
Wed, 30 Dec 2020 10:21:24 +0000 (11:21 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 30 Dec 2020 10:21:24 +0000 (11:21 +0100)
commit8f7941ca37001773a36add8119791725aeb823ba
treee2ca3ce142651d180577771f50190584cd2daf1f
parent86b3edf1ff26590077b5e968fca0b32dfdc2bf33
i386: Optimize pmovmskb on inverted vector to inversion of pmovmskb result [PR98461]

The following patch adds combine splitters to optimize:
-       vpcmpeqd        %ymm1, %ymm1, %ymm1
-       vpandn  %ymm1, %ymm0, %ymm0
        vpmovmskb       %ymm0, %eax
+       notl    %eax
etc. (for vectors with less than 32 elements with xorl instead of notl).

2020-12-30  Jakub Jelinek  <jakub@redhat.com>

PR target/98461
* config/i386/sse.md (<sse2_avx2>_pmovmskb): Add splitters
for pmovmskb of NOT vector.

* gcc.target/i386/sse2-pr98461.c: New test.
* gcc.target/i386/avx2-pr98461.c: New test.
gcc/config/i386/sse.md
gcc/testsuite/gcc.target/i386/avx2-pr98461.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/sse2-pr98461.c [new file with mode: 0644]