-
- Downloads
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.
Showing
- gcc/config/rs6000/altivec.md 11 additions, 3 deletionsgcc/config/rs6000/altivec.md
- gcc/config/rs6000/predicates.md 37 additions, 0 deletionsgcc/config/rs6000/predicates.md
- gcc/testsuite/gcc.target/powerpc/pr109069-1.c 25 additions, 0 deletionsgcc/testsuite/gcc.target/powerpc/pr109069-1.c
- gcc/testsuite/gcc.target/powerpc/pr109069-2-run.c 50 additions, 0 deletionsgcc/testsuite/gcc.target/powerpc/pr109069-2-run.c
- gcc/testsuite/gcc.target/powerpc/pr109069-2.c 12 additions, 0 deletionsgcc/testsuite/gcc.target/powerpc/pr109069-2.c
- gcc/testsuite/gcc.target/powerpc/pr109069-2.h 83 additions, 0 deletionsgcc/testsuite/gcc.target/powerpc/pr109069-2.h
Loading
Please register or sign in to comment