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

RISC-V: Add descending floating-point load/store pair fusion

RISC-V floating-point load/store pair fusion now supports descending memory addresses.

This commit introduces support for descending floating-point load/store pair fusion on RISC-V architectures. It reuses the existing pair matcher logic to add capability for pairs that access memory addresses in descending order. The change includes a new test case (fusion-fldfst-pair-dec.c) to verify this functionality. While the fusion capability is added, it is currently marked as XFAIL (expected to fail) in the test suite, as the selected tuning for the tests disables this specific capability, ensuring that the new code path is correctly integrated and can be tested once enabled.

In Details

The RISC-V fusion infrastructure in riscv-fusion.cc has been extended to support descending floating-point load/store pairs. A new enumeration value, RISCV_FUSE_FLDFST_PAIR_DEC, has been added to riscv_fusion_pairs, and the riscv_fusion_table is updated to include rules for this new fusion type. A dedicated function, riscv_fuse_fldfst_pair_dec, implements the matching logic. This enhancement allows the compiler to recognize and potentially fuse sequences of floating-point loads or stores that access memory addresses in decreasing order, provided the target microarchitecture supports…

For Context
macro-fusion
A compiler optimization that combines two or more simple instructions into a single, more complex instruction, often improving performance by reducing instruction fetch and decode overhead.
RISC-V
An open-standard instruction set architecture based on Reduced Instruction Set Computer principles.
load/store pairs
Instructions that load or store multiple consecutive memory locations in a single operation, improving memory access efficiency.
descending addresses
Memory addresses accessed in decreasing numerical order, e.g., from address N down to N-k.
RTL
Register Transfer Language. An intermediate representation used in GCC to describe operations on registers and memory.
XFAIL
Expected Failure. A marker in test suites indicating that a test is expected to fail for known reasons, often due to incomplete implementation or specific configuration limitations.
Filed Under: risc-vmacro-fusionfloating-pointcode generation