RISC-V floating-point widening ternary instructions avoid register overlap
Ensures floating-point widening ternary instructions on RISC-V do not cause register conflicts.
This commit adds test cases to verify that the source registers (vs1 and vs2) for RISC-V floating-point widening ternary instructions do not overlap with the destination register (vd). This is crucial because the destination register is also read as a wider accumulator, and such overlap could lead to incorrect results. The tests cover various instructions including vfwmacc.vv, vfwmsac.vv, and others.
In Details
This change adds test cases for the RISC-V Vector extension (RVV) to verify register group overlap for floating-point widening ternary instructions. Specifically, it ensures that the source vectors (vs1, vs2) used in instructions like vfwmacc.vv do not fall within the destination vector's (vd) register group, especially when the EEW (Element Extension Width) implies a wider accumulator. This prevents unintended read-after-write hazards where the accumulator read might corrupt data before it's written back.
- RISC-V
- An open-standard instruction set architecture (ISA) based on Reduced Instruction Set Computer principles. GCC supports various RISC-V configurations.
- RVV
- The RISC-V Vector extension, which adds support for SIMD (Single Instruction, Multiple Data) operations on vectors of data.
- widening ternary instructions
- Vector instructions that perform a ternary operation (three operands) and widen the data type of the result, typically used for fused multiply-accumulate operations.
- register group overlap
- A situation where different operands of an instruction (source, destination) refer to registers that are part of the same physical or logical register allocation group, potentially leading to data corruption or unexpected behavior if not handled correctly by the hardware or compiler.
- EEW
- Element Extension Width, a parameter in the RISC-V Vector extension that specifies the bit width of individual elements within a vector register. This determines the data type being operated on (e.g., 16-bit, 32-bit, 64-bit).