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

RISC-V: Revert RVV register overlap for vwmacc[u].vx

RISC-V compiler reverts RVV register overlap for widening multiply-add instructions using a scalar register.

GCC reverts changes that allowed register overlap in RISC-V vector widening multiply-add instructions (vwmacc[u].vx) which use a scalar register as one of the operands. This revert enforces compliance with the vector specification that prohibits a single register from supplying operands with different Effective Element Widths simultaneously. Test cases and instruction definitions are adjusted.

In Details

This commit reverts GCC's RISC-V backend to disallow register overlap for vwmacc[u].vx instructions. The RVV specification reserves encodings where a vector register (vd) acts as an accumulator with EEW = 2 * SEW, while source registers (vs1, vs2) operate with EEW = SEW. This commit enforces the rule that vs1 or vs2 must not overlap vd, even in the highest-numbered part, when one source is a scalar register (e.g., a0).

For Context
RISC-V Vector Extension (RVV)
An extension to the RISC-V instruction set architecture that provides support for single instruction, multiple data (SIMD) operations, enabling efficient processing of vector data.
vwmacc[u].vx
A RISC-V Vector Extension instruction for widening signed (vwmacc) or unsigned (vwmaccu) multiply-accumulate operations, where the destination is a vector register and one source is a scalar register, the other a vector register.
EEW (Effective Element Width)
In RISC-V vectors, this defines the bit width of individual elements within a vector register for a given operation. It can differ from the SEW (Standard Element Width).
SEW (Standard Element Width)
The base element width defined for a vector register, upon which EEW is often based.
Register Overlap
In this context, it refers to a situation where the same physical register can be interpreted as having different roles or widths simultaneously, which is disallowed by the RISC-V vector specification for certain instructions.
Filed Under: risc-vvector instructionscompiler