re PR target/87532 (bad results from vec_extract(unsigned char, foo) dependent upon...
authorKelvin Nilsen <kelvin@gcc.gnu.org>
Fri, 15 Mar 2019 19:52:43 +0000 (19:52 +0000)
committerKelvin Nilsen <kelvin@gcc.gnu.org>
Fri, 15 Mar 2019 19:52:43 +0000 (19:52 +0000)
commit30bb0e44d3893b27c6cd74c72a077e5a0d96a244
treed9bf3448990fc806c36eb62cc71cf34d4cdea326
parent167727579b725adba2e262129f664db474445273
re PR target/87532 (bad results from vec_extract(unsigned char, foo) dependent upon function inline)

gcc/ChangeLog:

2019-03-15  Kelvin Nilsen  <kelvin@gcc.gnu.org>

PR target/87532
* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
When handling vec_extract, use modular arithmetic to allow
constant selectors greater than vector length.
* config/rs6000/rs6000.c (rs6000_expand_vector_extract): Allow
V1TImode vectors to have constant selector values greater than 0.
Use modular arithmetic to compute vector index.
(rs6000_split_vec_extract_var): Use modular arithmetic to compute
index for in-memory vectors.  Correct code generation for
in-register vectors.
(altivec_expand_vec_ext_builtin): Use modular arithmetic to
compute index.

gcc/testsuite/ChangeLog:

2019-03-15  Kelvin Nilsen  <kelvin@gcc.gnu.org>

PR target/87532
* gcc.target/powerpc/fold-vec-extract-char.p8.c: Modify expected
instruction selection.
* gcc.target/powerpc/fold-vec-extract-int.p8.c: Likewise.
* gcc.target/powerpc/fold-vec-extract-short.p8.c: Likewise.
* gcc.target/powerpc/pr87532-mc.c: New test.
* gcc.target/powerpc/pr87532.c: New test.
* gcc.target/powerpc/vec-extract-v16qiu-v2.h: New test.
* gcc.target/powerpc/vec-extract-v16qiu-v2a.c: New test.
* gcc.target/powerpc/vec-extract-v16qiu-v2b.c: New test.
* gcc.target/powerpc/vsx-builtin-10a.c: New test.
* gcc.target/powerpc/vsx-builtin-10b.c: New test.
* gcc.target/powerpc/vsx-builtin-11a.c: New test.
* gcc.target/powerpc/vsx-builtin-11b.c: New test.
* gcc.target/powerpc/vsx-builtin-12a.c: New test.
* gcc.target/powerpc/vsx-builtin-12b.c: New test.
* gcc.target/powerpc/vsx-builtin-13a.c: New test.
* gcc.target/powerpc/vsx-builtin-13b.c: New test.
* gcc.target/powerpc/vsx-builtin-14a.c: New test.
* gcc.target/powerpc/vsx-builtin-14b.c: New test.
* gcc.target/powerpc/vsx-builtin-15a.c: New test.
* gcc.target/powerpc/vsx-builtin-15b.c: New test.
* gcc.target/powerpc/vsx-builtin-16a.c: New test.
* gcc.target/powerpc/vsx-builtin-16b.c: New test.
* gcc.target/powerpc/vsx-builtin-17a.c: New test.
* gcc.target/powerpc/vsx-builtin-17b.c: New test.
* gcc.target/powerpc/vsx-builtin-18a.c: New test.
* gcc.target/powerpc/vsx-builtin-18b.c: New test.
* gcc.target/powerpc/vsx-builtin-19a.c: New test.
* gcc.target/powerpc/vsx-builtin-19b.c: New test.
* gcc.target/powerpc/vsx-builtin-20a.c: New test.
* gcc.target/powerpc/vsx-builtin-20b.c: New test.
* gcc.target/powerpc/vsx-builtin-9a.c: New test.
* gcc.target/powerpc/vsx-builtin-9b.c: New test.

From-SVN: r269715
36 files changed:
gcc/ChangeLog
gcc/config/rs6000/rs6000-c.c
gcc/config/rs6000/rs6000.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/powerpc/fold-vec-extract-char.p8.c
gcc/testsuite/gcc.target/powerpc/fold-vec-extract-int.p8.c
gcc/testsuite/gcc.target/powerpc/fold-vec-extract-short.p8.c
gcc/testsuite/gcc.target/powerpc/pr87532-mc.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/pr87532.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extract-v16qiu-v2.h [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extract-v16qiu-v2a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vec-extract-v16qiu-v2b.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-10a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-10b.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-11a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-11b.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-12a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-12b.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-13a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-13b.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-14a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-14b.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-15a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-15b.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-16a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-16b.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-17a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-17b.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-18a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-18b.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-19a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-19b.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-20a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-20b.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-9a.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-9b.c [new file with mode: 0644]