i386: Add PPERM two-operand 64bit vector permutation [PR89021]
authorUros Bizjak <ubizjak@gmail.com>
Wed, 23 Jun 2021 14:14:31 +0000 (16:14 +0200)
committerUros Bizjak <ubizjak@gmail.com>
Wed, 23 Jun 2021 14:16:18 +0000 (16:16 +0200)
commit37e93925366676201b526624e9f8dc32d82b4ff2
treeed32b90a49693afd597530f0cb5be3c673437b5c
parent371c1992624c9269e2d5747561a8b27b30e485ee
i386: Add PPERM two-operand 64bit vector permutation [PR89021]

Add emulation of V8QI PPERM permutations for TARGET_XOP target.  Similar
to PSHUFB, the permutation is performed with V16QI PPERM instruction,
where selector is defined in V16QI mode with inactive elements set to 0x80.
Specific to two operand permutations is the remapping of elements from
the second operand (e.g. e[8] -> e[16]), as we have to account for the
inactive elements from the first operand.

2021-06-23  Uroš Bizjak  <ubizjak@gmail.com>

gcc/
PR target/89021
* config/i386/i386-expand.c (expand_vec_perm_pshufb):
Handle 64bit modes for TARGET_XOP.  Use indirect gen_* functions.
* config/i386/mmx.md (mmx_ppermv64): New insn pattern.
* config/i386/i386.md (unspec): Move UNSPEC_XOP_PERMUTE from ...
* config/i386/sse.md (unspec): ... here.
gcc/config/i386/i386-expand.c
gcc/config/i386/i386.md
gcc/config/i386/mmx.md
gcc/config/i386/sse.md