rs6000: Add Power10 optimization for _mm_blendv*
authorPaul A. Clarke <pc@us.ibm.com>
Thu, 21 Oct 2021 01:34:06 +0000 (20:34 -0500)
committerPaul A. Clarke <pc@us.ibm.com>
Mon, 10 Jan 2022 18:16:33 +0000 (12:16 -0600)
commitc173d880d651b9754f82af079e8d694418838a12
treefd8ff65208fb1453e5cd1f6bfed93f280c6e8c42
parentd3ff7420e941931d32ce2e332e7968fe67ba20af
rs6000: Add Power10 optimization for _mm_blendv*

Power10 ISA added `xxblendv*` instructions which are realized in the
`vec_blendv` instrinsic.

Use `vec_blendv` for `_mm_blendv_epi8`, `_mm_blendv_ps`, and
`_mm_blendv_pd` compatibility intrinsics, when `_ARCH_PWR10`.

Update original implementation of _mm_blendv_epi8 to use signed types,
to better match the function parameters. Realization is unchanged.

Also, copy a test from i386 for testing `_mm_blendv_ps`.
This should have come with commit ed04cf6d73e233c74c4e55c27f1cbd89ae4710e8,
but was inadvertently omitted.

2022-01-10  Paul A. Clarke  <pc@us.ibm.com>

gcc
* config/rs6000/smmintrin.h (_mm_blendv_epi8): Use vec_blendv
when _ARCH_PWR10. Use signed types.
(_mm_blendv_ps): Use vec_blendv when _ARCH_PWR10.
(_mm_blendv_pd): Likewise.

gcc/testsuite
* gcc.target/powerpc/sse4_1-blendvps.c: Copy from gcc.target/i386,
adjust dg directives to suit.
gcc/config/rs6000/smmintrin.h
gcc/testsuite/gcc.target/powerpc/sse4_1-blendvps.c [new file with mode: 0644]