rs6000: Add vector pdep/pext
authorKelvin Nilsen <kelvin@gcc.gnu.org>
Mon, 11 May 2020 15:04:03 +0000 (10:04 -0500)
committerBill Schmidt <wschmidt@linux.ibm.com>
Mon, 11 May 2020 15:04:03 +0000 (10:04 -0500)
commit894ac7bce590dc5036c7f1477b881dc767ce2e5a
treed9db3eeb9215e08be7f2d60f934326d31d29ad9a
parenta1821a249d998894dd38b14d5298647e8d7b5dc8
rs6000: Add vector pdep/pext

Add support for the vpdepd and vpextd instructions that perform
vector parallel bit deposit and vector parallel bit extract.

[gcc]

2020-05-11  Kelvin Nilsen  <kelvin@gcc.gnu.org>
    Bill Schmidt  <wschmidt@linux.ibm.com>

* config/rs6000/altivec.h (vec_pdep): New macro implementing new
built-in function.
(vec_pext): Likewise.
* config/rs6000/altivec.md (UNSPEC_VPDEPD): New constant.
(UNSPEC_VPEXTD): Likewise.
(vpdepd): New insn.
(vpextd): Likewise.
* config/rs6000/rs6000-builtin.def (__builtin_altivec_vpdepd): New
built-in function.
(__builtin_altivec_vpextd): Likewise.
* config/rs6000/rs6000-call.c (builtin_function_type): Add
handling for FUTURE_BUILTIN_VPDEPD and FUTURE_BUILTIN_VPEXTD
cases.
* doc/extend.texi (PowerPC Altivec Built-in Functions Available
for a Future Architecture): Add description of vec_pdep and
vec_pext built-in functions.

[gcc/testsuite]

2020-05-11  Kelvin Nilsen  <kelvin@gcc.gnu.org>

* gcc.target/powerpc/vec-pdep-0.c: New.
* gcc.target/powerpc/vec-pdep-1.c: New.
* gcc.target/powerpc/vec-pext-0.c: New.
* gcc.target/powerpc/vec-pext-1.c: New.
gcc/ChangeLog
gcc/config/rs6000/altivec.h
gcc/config/rs6000/altivec.md
gcc/config/rs6000/rs6000-builtin.def
gcc/config/rs6000/rs6000-call.c
gcc/doc/extend.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/vec-pdep-0.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-pdep-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-pext-0.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-pext-1.c [new file with mode: 0644]