https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109069

--- Comment #11 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The releases/gcc-13 branch has been updated by Kewen Lin <li...@gcc.gnu.org>:

https://gcc.gnu.org/g:5e24077cbe72d9335a2b23a3e4023cfd4707bd97

commit r13-7308-g5e24077cbe72d9335a2b23a3e4023cfd4707bd97
Author: Kewen Lin <li...@linux.ibm.com>
Date:   Wed Apr 26 00:21:05 2023 -0500

    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.

    (cherry picked from commit fd75f6ae5625f087980ff4a7e76cc6284cfe5a3e)

Reply via email to