Does vrgather.vx truncate x[rs1] to SEW?
No. x[rs1] is used as an element index; the animation treats it as an XLEN-wide nonnegative index and writes zero when the index is >= VLMAX.
Gather from vs2 using the scalar x[rs1] index for each active lane.
VRGATHER.VX uses x[rs1] as the element index so active destination elements read the same indexed position from vs2; an index greater than or equal to VLMAX produces zero.
Starts from OP-V encoding fields, then shows how VRGATHER uses the second source as element indexes, gathers from vs2 within VLMAX, and writes zero for out-of-range indexes.
Require V 1.0, enabled vector state and valid supported vtype/SEW; fix LMUL=m1 and vstart=0. This teaching configuration has VLEN=VLMAX×SEW=256 (at least 128 bits). Sources may be read beyond vl but below VLMAX; indexes ≥VLMAX return zero. Indexes are unsigned; vd cannot overlap any source group. Scalar indexes use full XLEN; x0 supplies zero. When v0 supplies the EEW=1 mask/borrow bits it cannot also supply data. Enter nonnegative element bit patterns. VL=0 updates no destination bits. Only body is shown without definite inactive/tail values; teaching stages are not processor cycles.
vrgather.vx uses OP-V encoding. The animation places fixed fields, register fields, vm, and the rs1 field in one encoding strip.
This animation shows OP-V field decode, indexed gather, execution masking, and vd writeback; teaching stages are not processor cycles.
vrgather.vx uses x[rs1] as one shared element index, so active lanes read vs2[x[rs1]]; an out-of-range index writes zero.
Syntax: vrgather.vx vd, vs2, rs1[, v0.t]; omit the mask for vm=1, include it for vm=0. 32-bit OP-V: opcode=1010111, funct3=100 (OPIVX), funct6=001100.
rs1 supplies an unsigned XLEN-wide index, not truncated to SEW; x0 supplies zero. Indexes select vs2 element numbers, including beyond vl but below VLMAX; indexes ≥VLMAX return zero without accessing memory.
Body is vstart≤i<vl; only mask-enabled body elements execute, with inactive/tail following vma/vta. Prestart is unchanged; vl=0 or vstart≥vl updates no destination elements.
vd cannot overlap any source vector register group; an ordinary masked vd cannot be v0. When v0 supplies EEW=1 mask/borrow bits it cannot also supply data; source groups cannot read a register with different EEWs. Group starts align to EMUL, EMUL≤8.
Require RV32/RV64 V 1.0, enabled vector state and valid supported vtype/SEW. The animation fixes m1 and vstart=0; VLEN=VLMAX×SEW≥128. Only body is shown; steps are not processor cycles.
Assume enabled V/VS, valid m1, supported SEW, VLEN=128, vl=4, vstart=0 and initialized sources, v0.mask[0..3]=1111. SEW=8, VLMAX=16, x5=3, v12[3]=40 → v8=[40,40,40,40]. Inactive/tail follow vma/vta. vl=0 leaves vd unchanged.
Assume enabled V/VS, valid m1, supported SEW, VLEN=128, vl=4, vstart=0 and initialized sources, v0.mask[0..3]=1111. SEW=8, VLMAX=16, x5=3, v12[3]=40 → v8=[40,40,40,40]. Inactive/tail follow vma/vta. vl=0 leaves vd unchanged.
No. x[rs1] is used as an element index; the animation treats it as an XLEN-wide nonnegative index and writes zero when the index is >= VLMAX.