Check vl first
The current vl determines the number of body elements. Typical code executes vsetvli, vsetivli, or vsetvl before this instruction.
Subtract vector elements from a sign-extended immediate.
VRSUB.VI computes signext(imm) - vs2[i] for active elements and writes the low SEW bits to vd.
Starts from OP-V encoding fields, then shows how VRSUB subtracts vs2 from the second source, wraps at SEW, and writes vd.
vrsub.vi uses OP-V encoding. The animation places fixed fields, register fields, vm, and the imm field in one encoding strip.
This animation shows only ISA-visible relationships from the official V extension: OP-V field decode, active-element reads, SEW-width integer reverse subtraction, mask control, and vd writeback. It does not model pipelines, caches, or timing.
VRSUB.VI computes sign-extended imm - vs2[i] for each active element. The VI form uses a 5-bit signed immediate in the range -16 through 15.
When reading VRSUB.VI, do not stop at the mnemonic. Official V-extension semantics also depend on the current vl, vtype, and mask state. .vi: one vector source and a small immediate participate.
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 «vrsub.vi v8, v12, 7, v0.t».
Understand this scenario with real code like «vrsub.vi v8, v12, 7, v0.t».
The VI form uses a 5-bit signed immediate, ranging from -16 to 15, sign-extended before the operation.
Ordinary single-width integer subtraction provides VSUB.VV, VSUB.VX, and reverse-subtract VRSUB.VX/VRSUB.VI; vector minus immediate is not a separate VSUB.VI form.