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

RISC-V: Add test cases for vwsub.wv vs1 reg overlap

New RISC-V test cases verify correct register usage for vwsub.wv instruction.

This commit introduces a suite of new test cases for the RISC-V vector extension, specifically targeting the vwsub.wv instruction. The tests focus on ensuring that the vs1 register does not overlap with the vs2 register group, which is a critical aspect of correct vector register allocation and instruction execution. These tests aim to prevent miscompiles related to register constraints in vector operations.

In Details

RISC-V vector extension testsuite updates. New tests are added for vwsub.wv to verify register constraints where vs1 must not alias vs2 under specific encoding rules (EEW = SEW for vs1, EEW = 2*SEW for vs2). This ensures compliance with spec section 5.2 regarding differing EEWs for source operands.

For Context
vwsub.wv
A RISC-V vector instruction for wide subtract with a scalar value in the second source register. It performs element-wise subtraction, widening the elements of the first source vector by the second source register's elements.
vs1
The first source vector register in a RISC-V vector instruction. It holds one of the operands for the vector operation.
vs2
The second source vector register in a RISC-V vector instruction. It holds the other operand for the vector operation, often with a different element width (EEW) than the destination (vd) or vs1.
EEW
Element Extension Width. In RISC-V vector operations, EEW determines the width of elements being processed, which can be different from the SEW (Standard Element Width) for certain widening or narrowing operations.
SEW
Standard Element Width. The base width of elements in a vector register, typically 8, 16, 32, or 64 bits.
register overlap
A situation in instruction scheduling and register allocation where two or more registers are required to hold values simultaneously, but the hardware or instruction encoding imposes constraints that prevent certain overlaps, potentially leading to miscompiles or incorrect behavior.
Filed Under: risc-vvectortestsuite