i386: Optimize _mm_unpacklo_epi8 of 0 vector as second argument or similar VEC_PERM_E...
authorJakub Jelinek <jakub@redhat.com>
Wed, 13 Jan 2021 07:02:54 +0000 (08:02 +0100)
committerJakub Jelinek <jakub@redhat.com>
Wed, 13 Jan 2021 07:06:25 +0000 (08:06 +0100)
commitb668a06e37f72fd96bacd6769990ec97dac4ac6d
tree0c71ee709d96084a2d1e36cea217ba4007040b8b
parent7993fe1877a689463d8c71a0873e5cc8db080273
i386: Optimize _mm_unpacklo_epi8 of 0 vector as second argument or similar VEC_PERM_EXPRs into pmovzx [PR95905]

The following patch adds patterns (so far 128-bit only) for permutations
like { 0 16 1 17 2 18 3 19 4 20 5 21 6 22 7 23 } where the second
operand is CONST0_RTX CONST_VECTOR to be emitted as pmovzx.

2021-01-13  Jakub Jelinek  <jakub@redhat.com>

PR target/95905
* config/i386/predicates.md (pmovzx_parallel): New predicate.
* config/i386/sse.md (*sse4_1_zero_extendv8qiv8hi2_3): New
define_insn_and_split pattern.
(*sse4_1_zero_extendv4hiv4si2_3): Likewise.
(*sse4_1_zero_extendv2siv2di2_3): Likewise.

* gcc.target/i386/pr95905-1.c: New test.
* gcc.target/i386/pr95905-2.c: New test.
gcc/config/i386/predicates.md
gcc/config/i386/sse.md
gcc/testsuite/gcc.target/i386/pr95905-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/i386/pr95905-2.c [new file with mode: 0644]