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

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

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

commit r17-3439-g6c171ef2c1ba0b71505f1c6e93c8d3c8d90bdaca
Author: Konstantinos Eleftheriou <[email protected]>
Date:   Wed Jul 8 02:56:54 2026 -0700

    forwprop: Add long-multiply two-carry variant

    Extend the long-multiply fold to the variant where the cross sum and
    the low-half accumulation each carry through a separate unsigned
    overflow compare:

      xh*yh + (cross_sum >> N) + carry_low + ((hilo > cross_sum) << N)
      cross_sum = xh*yl + xl*yh
      carry_low = (xl*yl + (cross_sum << N)) < (cross_sum << N)

    An extra check validates the carry_low operands against the multiset's
    canonical (op0, op1).

            PR tree-optimization/107090

    gcc/ChangeLog:

            * match.pd: Add mul_carry_low atom recognizer.
            * tree-ssa-forwprop.cc (gimple_mul_carry_low): Declare.
            (enum long_mul_kind): Add LMK_CARRY_LOW.
            (struct long_mul_summand): Add carry_a / carry_b for the
            LMK_CARRY_LOW summand's two operands.
            (long_mul_set_summand): Handle LMK_CARRY_LOW.
            (long_mul_classify_carry): Try mul_carry_low after the
            more-constrained mul_carry_low_sum / mul_carry_cross_sum.
            (long_mul_find_summand): New helper, find the first summand
            with a given kind.
            (long_mul_check_two_carries): New extra check, validates the
            LMK_CARRY_LOW summand's operands against the canonical
            (op0, op1); gates the two-carry HIGH_PART row added to
            long_mul_table.

    gcc/testsuite/ChangeLog:

            * gcc.dg/tree-ssa/long-mul-two-carry.c: New test.

Reply via email to