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

--- Comment #7 from GCC Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Xi Ruoyao <[email protected]>:

https://gcc.gnu.org/g:6abaf53d84db86bd917d18cac5aac3c3bf37929c

commit r17-2510-g6abaf53d84db86bd917d18cac5aac3c3bf37929c
Author: Xi Ruoyao <[email protected]>
Date:   Tue Jul 14 15:03:19 2026 +0800

    LoongArch: fix par_const_vector_shf_set_operand for vshuf4i [PR 126200]

    The logic of par_const_vector_shf_set_operand (actually,
    loongarch_const_vector_shuffle_set_p) expect mode to have the same
    element count as the shuffled vector.  But the lsx_vshuf4i_<lsxfmt_f>
    definition have VOIDmode for the mode of the selector, thus the
    predicate actually accepts anything.  The issue was somehow latent until
    recently fwprop1 seems improved on folding two vec_select into one.

    Change par_const_vector_shf_set_operand to a special predicate so we can
    specify a mode different from the actual mode of the selector parallel
    (in VOIDmode) to the predicate.  Then specify VIMODE to satisfy the
    expectation of loongarch_const_vector_shuffle_set_p.

            PR target/126200

    gcc/

            * config/loongarch/predicates.md
            (par_const_vector_shf_set_operand): Define as special predicate.
            * config/loongarch/lsx.md (lsx_vshuf4i_<lsxfmt_f>): Pass VIMODE
            to the predicate of selector.

    gcc/testsuite/

            * gcc.target/loongarch/vector/lsx/pr126200.c: New test.

Reply via email to