Check vl first
The current vl determines the number of body elements. Typical code executes vsetvli, vsetivli, or vsetvl before this instruction.
Gather vector elements from vs2 using 16-bit index elements.
VRGATHEREI16.VV uses EEW=16 index elements in vs1 to select elements from vs2 into vd; an index greater than or equal to VLMAX produces zero, and the index width is independent of data SEW.
Starts from OP-V encoding fields, then shows how VRGATHEREI16 gathers vs2 data with 16-bit index elements whose width is independent of data SEW.
vrgatherei16.vv uses OP-V encoding. The animation places fixed fields, register fields, vm, and the vs1 field in one encoding strip.
This animation shows only ISA-visible relationships from the official V extension: OP-V field decode, active-element reads, element-index/packing/select/move rearrangement integer 16-bit indexed gather, boundary/selection rules, and vd writeback. It does not model pipelines, caches, or timing.
vrgatherei16.vv is similar to vrgather.vv, but vs1 index elements are fixed at 16 bits; active lanes read vs2[index], and out-of-range indexes write zero.
When reading VRGATHEREI16.VV, do not stop at the mnemonic. Official V-extension semantics also depend on the current vl, vtype, and mask state. .vv: two vector sources participate element by element.
The current vl determines the number of body elements. Typical code executes vsetvli, vsetivli, or vsetvl before this instruction.
The current vtype supplies SEW, LMUL, tail policy, and mask policy; these affect element width, register-group size, and inactive/tail destination elements.
For ordinary vector instructions with vm, vm=0 uses v0 as the execution mask and vm=1 is unmasked. A few forms such as VMERGE use v0 as data-selection input.
Understand this scenario with real code like «vrgatherei16.vv v8, v12, v4, v0.t».
Understand this scenario with real code like «vrgatherei16.vv v8, v12, v4, v0.t».
vrgatherei16.vv uses fixed 16-bit index elements; vrgather.vv uses index elements with the current SEW width. Both write zero for out-of-range indexes.