i386: Optimize pmovskb on zero_extend of subreg HI of pmovskb result [PR98461]
authorliuhongt <hongtao.liu@intel.com>
Mon, 4 Jan 2021 03:24:30 +0000 (11:24 +0800)
committerliuhongt <hongtao.liu@intel.com>
Tue, 5 Jan 2021 11:39:46 +0000 (19:39 +0800)
commitbea984814c6fcd056dc80c99805925eb19a591b9
tree33fa2cdc417a299aaf5c9f760fa714c128a298ad
parente8beba1cfc761cc35762283b3b44a355ef05e25b
i386: Optimize pmovskb on zero_extend of subreg HI of pmovskb result [PR98461]

The following patch adds define_insn_and_split to optimize

       vpmovmskb       %xmm0, %eax
-       movzwl  %ax, %eax
        notl    %eax

and combine splitter to optimize

        pmovmskb        %xmm0, %eax
-       notl    %eax
-       movzwl  %ax, %eax
+       xorl    $65535, %eax

gcc/ChangeLog
PR target/98461
* config/i386/sse.md (*sse2_pmovskb_zexthisi): New
define_insn_and_split for zero_extend of subreg HI of pmovskb
result.
(*sse2_pmovskb_zexthisi): Add new combine splitters for
zero_extend of not of subreg HI of pmovskb result.

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