GCC Newspaper
NOVEMBER 30, 2026
Date
/
Architectures
Components
Topics
News & Policy
Other
gcc/risc-v

Fix RISC-V pack instruction tests after any-or-plus changes

RISC-V compiler tests for pack instructions are fixed after compiler-wide changes to handling operations with non-overlapping bit sets.

This commit addresses RISC-V compiler test failures related to pack instructions, which arose after recent changes to how the compiler handles operations where inputs have no overlapping set bits (any-or-plus, or AOP). The compiler now uses a code iterator and pattern matching to correctly identify and cost these operations, ensuring that explicit OR matching RTL and prior costing mechanisms are updated for the new forms. This resolves all pack instruction failures in default test runs for RISC-V.

In Details

The RISC-V port's crypto.md patterns for pack instructions now use a new oxp code iterator to match operations with non-overlapping bit sets, which are now steered by the compiler's any-or-plus (AOP) logic towards the PLUS form. The costing in riscv_rtx_costs was updated to handle these new forms, preventing overly high costs that previously caused combine to reject them. This change decouples the pack instruction handling from specific IOR matching, supporting the more general PLUS form.

Filed Under: risc-vcompilertesting