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

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

https://gcc.gnu.org/g:8835caacb1b5d929b9df3ec873570b73e41a6847

commit r17-5837-g8835caacb1b5d929b9df3ec873570b73e41a6847
Author: liuhongt <[email protected]>
Date:   Thu Oct 29 19:44:35 2026 -0700

    match.pd: Fold masked vector multiply to widening even/odd multiply
[PR124271]

    (x & lowhalf_mask) * (y & lowhalf_mask) on an integer vector only
    multiplies the zero-extended low halves of each element.  That is
    VEC_WIDEN_MULT_EVEN_EXPR of x and y viewed as vectors of half-width
    unsigned elements (VEC_WIDEN_MULT_ODD_EXPR on big-endian, where the low
    halves are the odd lanes).

    On x86 this replaces the V*DImode multiply emulation (3 pmuludq plus
    shifts and adds) with a single pmuludq, and replaces vpmullq when
    AVX512DQ is available.

    gcc/ChangeLog:

            PR target/124271
            * match.pd ((x & lowhalf_mask) * (y & lowhalf_mask)): New
            simplification to VEC_WIDEN_MULT_{EVEN,ODD}_EXPR.

    gcc/testsuite/ChangeLog:

            PR target/124271
            * gcc.dg/torture/pr124271.c: New test.
            * gcc.target/i386/pr124271-1.c: New test.
            * gcc.target/i386/pr124271-2.c: New test.

Reply via email to