RISC-V: Revert RVV register overlap for vwmaccus.vx
RISC-V compiler reverts RVV register overlap for widening unsigned multiply-add instructions with a scalar register.
GCC reverts changes that allowed register overlap for the RISC-V vector widening unsigned multiply-add instruction (vwmaccus.vx), which uses a scalar register. This ensures compliance with the vector specification’s prohibition on a single register serving operands with disparate Effective Element Widths. Test cases and instruction definitions are updated.
In Details
This commit reverts GCC's RISC-V backend to disallow register overlap for the vwmaccus.vx instruction. This instruction operates similarly to vwmacc[u].vx, where the destination vector register (vd) acts as an accumulator with EEW = 2 * SEW, while source registers (vs1, vs2) use EEW = SEW. The RVV specification reserves encodings that prevent vs1 or vs2 from overlapping vd when one source is a scalar register, due to differing EEWs.
- 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.
- vwmaccus.vx
- A RISC-V Vector Extension instruction for widening unsigned multiply-accumulate operations, where the destination is a vector register, one source is a scalar register, and 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.