rs6000-c.c (altivec_resolve_overloaded_builtin): Add support for vec_extract on vecto...
authorMichael Meissner <meissner@gcc.gnu.org>
Mon, 1 Aug 2016 23:27:38 +0000 (23:27 +0000)
committerMichael Meissner <meissner@gcc.gnu.org>
Mon, 1 Aug 2016 23:27:38 +0000 (23:27 +0000)
commite2a9919451fc3ff2ce9d90152cc1f6526b98cce3
treebe32d404c0080a73c0b9158ff5d20a1437865f28
parent72a30e45c5629a3f1cece39777b71a557eed3c57
rs6000-c.c (altivec_resolve_overloaded_builtin): Add support for vec_extract on vector float...

[gcc]
2016-08-01  Michael Meissner  <meissner@linux.vnet.ibm.com>

* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
Add support for vec_extract on vector float, vector int, vector
short, and vector char vector types.
* config/rs6000/rs6000.c (rs6000_expand_vector_extract): Add
vector float, vector int, vector short, and vector char
optimizations on 64-bit ISA 2.07 systems for both constant and
variable element numbers.
(rs6000_split_vec_extract_var): Likewise.
* config/rs6000/vsx.md (vsx_xscvspdp_scalar2): Allow SFmode to be
Altivec registers on ISA 2.07 and above.
(vsx_extract_v4sf): Delete alternative that hard coded element 0,
which never was matched due to the split occuring before register
allocation (and the code would not have worked on little endian
systems if it did match).  Allow extracts to go to the Altivec
registers if ISA 2.07 (power8).  Change from using "" around the
C++ code to using {}'s.
(vsx_extract_v4sf_<mode>_load): New insn to optimize vector float
vec_extracts when the vector is in memory.
(vsx_extract_v4sf_var): New insn to optimize vector float
vec_extracts when the element number is variable on 64-bit ISA
2.07 systems.
(vsx_extract_<mode>, VSX_EXTRACT_I iterator): Add optimizations
for 64-bit ISA 2.07 as well as ISA 3.0.
(vsx_extract_<mode>_p9, VSX_EXTRACT_I iterator): Likewise.
(vsx_extract_<mode>_p8, VSX_EXTRACT_I iterator): Likewise.
(vsx_extract_<mode>_load, VSX_EXTRACT_I iterator): New insn to
optimize vector int, vector short, and vector char vec_extracts
when the vector is in memory.
(vsx_extract_<mode>_var, VSX_EXTRACT_I iterator): New insn to
optimize vector int, vector short, and vector char vec_extracts
when the element number is variable.

[gcc/testsuite]
2016-08-01  Michael Meissner  <meissner@linux.vnet.ibm.com>

* gcc.target/powerpc/vec-extract-5.c: New tests to test
vec_extract for vector float, vector int, vector short, and vector
char.
* gcc.target/powerpc/vec-extract-6.c: Likewise.
* gcc.target/powerpc/vec-extract-7.c: Likewise.
* gcc.target/powerpc/vec-extract-8.c: Likewise.
* gcc.target/powerpc/vec-extract-9.c: Likewise.

From-SVN: r238971
gcc/ChangeLog
gcc/config/rs6000/rs6000-c.c
gcc/config/rs6000/rs6000.c
gcc/config/rs6000/vsx.md
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/vec-extract-5.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extract-6.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extract-7.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extract-8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extract-9.c [new file with mode: 0644]