diff options
author | Kewen Lin <linkw@linux.ibm.com> | 2023-04-26 00:21:05 -0500 |
---|---|---|
committer | Kewen Lin <linkw@linux.ibm.com> | 2023-04-26 00:21:05 -0500 |
commit | fd75f6ae5625f087980ff4a7e76cc6284cfe5a3e (patch) | |
tree | 5f05da4c1ddadc636c197459f694245a9c00d6dd /gcc/tree-parloops.cc | |
parent | 06792c142c5ac8424db1ca36d11b0b9d42de3f21 (diff) | |
download | gcc-fd75f6ae5625f087980ff4a7e76cc6284cfe5a3e.zip gcc-fd75f6ae5625f087980ff4a7e76cc6284cfe5a3e.tar.gz gcc-fd75f6ae5625f087980ff4a7e76cc6284cfe5a3e.tar.bz2 |
rs6000: Fix predicate for const vector in sldoi_to_mov [PR109069]
As PR109069 shows, commit r12-6537-g080a06fcb076b3 which
introduces define_insn_and_split sldoi_to_mov adopts
easy_vector_constant for const vector of interest, but it's
wrong since predicate easy_vector_constant doesn't guarantee
each byte in the const vector is the same. One counter
example is the const vector in pr109069-1.c. This patch is
to introduce new predicate const_vector_each_byte_same to
ensure all bytes in the given const vector are the same by
considering both int and float, meanwhile for the constants
which don't meet easy_vector_constant we need to gen a move
instead of just a set, and uses VECTOR_MEM_ALTIVEC_OR_VSX_P
rather than VECTOR_UNIT_ALTIVEC_OR_VSX_P for V2DImode support
under VSX since vector long long type of vec_sld is guarded
under stanza vsx.
PR target/109069
gcc/ChangeLog:
* config/rs6000/altivec.md (sldoi_to_mov<mode>): Replace predicate
easy_vector_constant with const_vector_each_byte_same, add
handlings in preparation for !easy_vector_constant, and update
VECTOR_UNIT_ALTIVEC_OR_VSX_P with VECTOR_MEM_ALTIVEC_OR_VSX_P.
* config/rs6000/predicates.md (const_vector_each_byte_same): New
predicate.
gcc/testsuite/ChangeLog:
* gcc.target/powerpc/pr109069-1.c: New test.
* gcc.target/powerpc/pr109069-2-run.c: New test.
* gcc.target/powerpc/pr109069-2.c: New test.
* gcc.target/powerpc/pr109069-2.h: New test.
Diffstat (limited to 'gcc/tree-parloops.cc')
0 files changed, 0 insertions, 0 deletions