RISC-V "V" extension (RVV): ISA-level SIMD
RVV adds a configurable-width vector register file to any RISC-V CPU. The vector length VLEN (typically 128–512 bits) determines how many elements fit in one register.
# Compute 64-element int8 dot product with RVV
vsetvli t0, a2, e8, m1, ta, ma # set vector length for int8
vle8.v v0, (a0) # load 64 input values
vle8.v v1, (a1) # load 64 weight values
vwmul.vv v2, v0, v1 # widening multiply: int8 → int16
vwredsum.vs v3, v2, v4 # reduce to scalar
For VLEN=512: one vwmul.vv multiplies 64 pairs simultaneously — an entire inner-loop iteration of our Conv2D in 2 instructions.
Why we did not build RVV: it requires changes to the register file (8 vector registers of VLEN bits each = 512 bytes at VLEN=512), the decode logic, and the datapath. Far more complex than a separate peripheral. But for production hardware, RVV eliminates the bus-overhead penalty that memory-mapped peripherals pay.