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

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

https://gcc.gnu.org/g:82787e703f9782b113d0ddf6944b50814986205f

commit r17-4918-g82787e703f9782b113d0ddf6944b50814986205f
Author: Richard Biener <[email protected]>
Date:   Fri Sep 18 13:35:42 2026 +0200

    [x86][v2] umul<mode>3_highpart for VnDI

    This implements umul<mode>3_highpart for V2DI, V4DI and V8DI using
    SSE2 instructions, specifically exercising pmuludq.  I wasn't able
    to produce a scalar vectorizer pattern open-coding a sequence that
    would vectorize to this, specifically with the same VF and the
    setup of the input to the pmuludq, so I opted for implementing
    this in the target.

    I added a testcase for a V2DI loop that shouldn't be vectorized
    and one for a V4DI loop that should.

    This speeds up 750.sealcrypto_r by ~20% on Zen4 and should recover what
    was lost with r17-3437.

    v2:
     - merge the two function costing parts, use SImode multiplication cost,
       VnDImode multiplication cost is not accurate for the SImode widening
       multiplication we want to use
     - add similar costing to the MULT_HIGHPART_EXPR case
     - alternate multiplication sequence, squeezing out a few ops

            PR tree-optimization/127452
            * config/i386/i386-protos.h (ix86_expand_umulvndi_highpart):
Declare.
            * config/i386/i386-expand.cc (ix86_expand_umulvndi_highpart):
            New function.
            * config/i386/sse.md (umul<mode>3_highpart): Add for
VI8_AVX2_AVX512F.
            * config/i386/i386.cc (ix86_vector_costs::add_stmt_cost): Cost
            IFN_MULH as we implement it.

            * gcc.target/i386/vect-umulv2di_high.c: New testcase.
            * gcc.target/i386/vect-umulv4di_high.c: Likewise.

Reply via email to