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

RISC-V: Add test cases for vwadd[u].wv register group overlap

New test cases verify RISC-V vector instructions handle register overlaps correctly.

Several commits add new test cases to the RISC-V test suite. These tests focus on the vwadd.wv and vwaddu.wv vector instructions, specifically ensuring that the source register vs1 does not improperly overlap with the destination register vd or the other source register vs2. One commit adjusts existing test cases for m4 configurations where register allocation changed due to high register pressure.

In Details

These commits add tests for RISC-V vector instructions, specifically vwadd.wv and vwaddu.wv. The tests verify correct handling of register allocation and potential overlaps between source (vs1, vs2) and destination (vd) vector registers, particularly when vs1 might originate from the same register group as vs2. This addresses issues related to the vector extension's encoding constraints, such as Wn4, ensuring compliance with the specification, especially under high register pressure.

For Context
RISC-V
An open-standard instruction set architecture (ISA) based on Reduced Instruction Set Computer principles. GCC supports various RISC-V profiles and extensions.
vector extension
A set of instructions that operate on multiple data elements in parallel, often used for high-performance computing and signal processing. GCC's support for vector extensions allows for SIMD (Single Instruction, Multiple Data) operations.
SEW
Standard Element Width. In the RISC-V vector extension, this defines the width of individual elements within a vector register.
EEW
Effective Element Width. This is the actual width of elements processed by a vector instruction, which can be different from SEW due to widening or narrowing operations.
register group
A logical grouping of vector registers on the RISC-V architecture, often defined by the vector extension specification. Certain instructions or operand types may have constraints on which register groups they can use to avoid conflicts or ensure proper operation.
vs1
The first source vector register operand for a RISC-V vector instruction.
vs2
The second source vector register operand for a RISC-V vector instruction.
vd
The destination vector register for a RISC-V vector instruction.
Wn4 constraint
A constraint in RISC-V vector assembly that specifies a requirement for a register, often related to its EEW or its alignment within a larger register group. 'Wn4' likely refers to a constraint on a register that is 4 elements wide.
Filed Under: risc-vvectortesting