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

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

https://gcc.gnu.org/g:5385c9588b1a76cbba5e42443673681f033c5d77

commit r17-88-g5385c9588b1a76cbba5e42443673681f033c5d77
Author: Jeff Law <[email protected]>
Date:   Sat Apr 25 12:18:34 2026 -0600

    [RISC-V][PR target/123904] Improve bit masking of shifted values

    If we are masking off bits on the upper and lower part of a register on
riscv,
    depending on the precise mask it may be best implemented as a shift
triplet.
    ie, shift left to clear upper bits, shift right to clear lower bits, shift
left
    again to put the bits into their proper position.

    If the input value is already left shifted and the shift count corresponds
to
    the low mask bits, then we can get away with just two shifts.  We shift
left to
    clear the relevant high bits, then shift right to put them into their
proper
    position.

    This likey came from spec or coremark given it was reported to me by the
RAU
    team a while back.  But the testcase didn't include enough breadcrumbs to
know
    for sure.

    This has been repeatedly bootstrapped and regression tested on the Pioneer
and
    BPI as well as regularly regression tested on the riscv32-elf and
riscv64-elf
    embedded targets.

    I'll wait for pre-commit CI to spin before pushing to the trunk.

            PR target/123904
    gcc/
            * config/riscv/riscv.md (masking shifted value): New splitter to
            optimize certain masking operations on shifted values.

    gcc/testsuite/
            * gcc.target/riscv/pr123904.c: New test.
  • [Bug target/123904] Failure to ... cvs-commit at gcc dot gnu.org via Gcc-bugs

Reply via email to