rs6000: Add vec_extracth and vec_extractl
authorKelvin Nilsen <kelvin@gcc.gnu.org>
Wed, 13 May 2020 21:09:17 +0000 (16:09 -0500)
committerBill Schmidt <wschmidt@linux.ibm.com>
Wed, 13 May 2020 21:09:17 +0000 (16:09 -0500)
commitc21d2b6661c82a455be551d55e4e17005b480ad3
treebe7e0fdb6fcd498b979b5959df7d40f86a560296
parent4924293a62ee797310dd448e545118afd5aebb3f
rs6000: Add vec_extracth and vec_extractl

Add new insns vextdu[bhw]vlx, vextddvlx, vextdu[bhw]vhx, and
vextddvhx, along with built-in access and overloaded built-in
access to these insns.

[gcc]

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

* config/rs6000/altivec.h (vec_extractl): New #define.
(vec_extracth): Likewise.
* config/rs6000/altivec.md (UNSPEC_EXTRACTL): New constant.
(UNSPEC_EXTRACTR): Likewise.
(vextractl<mode>): New expansion.
(vextractl<mode>_internal): New insn.
(vextractr<mode>): New expansion.
(vextractr<mode>_internal): New insn.
* config/rs6000/rs6000-builtin.def (__builtin_altivec_vextdubvlx):
New built-in function.
(__builtin_altivec_vextduhvlx): Likewise.
(__builtin_altivec_vextduwvlx): Likewise.
(__builtin_altivec_vextddvlx): Likewise.
(__builtin_altivec_vextdubvhx): Likewise.
(__builtin_altivec_vextduhvhx): Likewise.
(__builtin_altivec_vextduwvhx): Likewise.
(__builtin_altivec_vextddvhx): Likewise.
(__builtin_vec_extractl): New overloaded built-in function.
(__builtin_vec_extracth): Likewise.
* config/rs6000/rs6000-call.c (altivec_overloaded_builtins):
Define overloaded forms of __builtin_vec_extractl and
__builtin_vec_extracth.
(builtin_function_type): Add cases to mark arguments of new
built-in functions as unsigned.
(rs6000_common_init_builtins): Add
opaque_ftype_opaque_opaque_opaque_opaque.
* config/rs6000/rs6000.md (du_or_d): New mode attribute.
* doc/extend.texi (PowerPC AltiVec Built-in Functions Available
for a Future Architecture): Add description of vec_extractl and
vec_extractr built-in functions.

[gcc/testsuite]

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

* gcc.target/powerpc/vec-extracth-0.c: New.
* gcc.target/powerpc/vec-extracth-1.c: New.
* gcc.target/powerpc/vec-extracth-2.c: New.
* gcc.target/powerpc/vec-extracth-3.c: New.
* gcc.target/powerpc/vec-extracth-4.c: New.
* gcc.target/powerpc/vec-extracth-5.c: New.
* gcc.target/powerpc/vec-extracth-6.c: New.
* gcc.target/powerpc/vec-extracth-7.c: New.
* gcc.target/powerpc/vec-extracth-be-0.c: New.
* gcc.target/powerpc/vec-extracth-be-1.c: New.
* gcc.target/powerpc/vec-extracth-be-2.c: New.
* gcc.target/powerpc/vec-extracth-be-3.c: New.
* gcc.target/powerpc/vec-extractl-0.c: New.
* gcc.target/powerpc/vec-extractl-1.c: New.
* gcc.target/powerpc/vec-extractl-2.c: New.
* gcc.target/powerpc/vec-extractl-3.c: New.
* gcc.target/powerpc/vec-extractl-4.c: New.
* gcc.target/powerpc/vec-extractl-5.c: New.
* gcc.target/powerpc/vec-extractl-6.c: New.
* gcc.target/powerpc/vec-extractl-7.c: New.
* gcc.target/powerpc/vec-extractl-be-0.c: New.
* gcc.target/powerpc/vec-extractl-be-1.c: New.
* gcc.target/powerpc/vec-extractl-be-2.c: New.
* gcc.target/powerpc/vec-extractl-be-3.c: New.
32 files changed:
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/config/rs6000/rs6000.md
gcc/doc/extend.texi
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/vec-extracth-0.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extracth-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extracth-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extracth-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extracth-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extracth-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extracth-6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extracth-7.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extracth-be-0.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extracth-be-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extracth-be-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extracth-be-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extractl-0.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extractl-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extractl-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extractl-3.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extractl-4.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extractl-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extractl-6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extractl-7.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extractl-be-0.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extractl-be-1.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extractl-be-2.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extractl-be-3.c [new file with mode: 0644]