rs6000: Enable vec_insert for P8 with rs6000_expand_vector_set_var_p8 [PR98093]
authorXionghu Luo <luoxhu@linux.ibm.com>
Fri, 22 Jan 2021 03:03:28 +0000 (21:03 -0600)
committerXionghu Luo <luoxhu@linux.ibm.com>
Fri, 22 Jan 2021 14:05:32 +0000 (08:05 -0600)
commite3a8ef8ef2ac077b393687624b09db6ab31c7746
treec2c188d80a10edb6f5409ddb327519e6c2dcdf72
parentb29225597584b697762585e0b707b7cb4b427650
rs6000: Enable vec_insert for P8 with rs6000_expand_vector_set_var_p8 [PR98093]

Support P8 variable vec_insert and Update testcases' instruction count.

gcc/ChangeLog:

2021-01-22  Xionghu Luo  <luoxhu@linux.ibm.com>

PR target/98093

* config/rs6000/rs6000-c.c (altivec_resolve_overloaded_builtin):
Generate ARRAY_REF(VIEW_CONVERT_EXPR) for P8 and later
platforms.
* config/rs6000/rs6000.c (rs6000_expand_vector_set_var): Update
to call different path for P8 and P9.
(rs6000_expand_vector_set_var_p9): New function.
(rs6000_expand_vector_set_var_p8): New function.

gcc/testsuite/ChangeLog:

2021-01-22  Xionghu Luo  <luoxhu@linux.ibm.com>

* gcc.target/powerpc/pr79251.p8.c: New test.
* gcc.target/powerpc/fold-vec-insert-char-p8.c: Adjust
instruction counts.
* gcc.target/powerpc/fold-vec-insert-char-p9.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-double.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-float-p8.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-float-p9.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-int-p8.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-int-p9.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-longlong.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-short-p8.c: Likewise.
* gcc.target/powerpc/fold-vec-insert-short-p9.c: Likewise.
* gcc.target/powerpc/vsx-builtin-7.c: Likewise.
14 files changed:
gcc/config/rs6000/rs6000-c.c
gcc/config/rs6000/rs6000.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-char-p8.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-char-p9.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-double.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-float-p8.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-float-p9.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-int-p8.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-int-p9.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-longlong.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-short-p8.c
gcc/testsuite/gcc.target/powerpc/fold-vec-insert-short-p9.c
gcc/testsuite/gcc.target/powerpc/pr79251.p8.c [new file with mode: 0644]
gcc/testsuite/gcc.target/powerpc/vsx-builtin-7.c