Check vl first
The current vl determines the number of body elements. Typical code executes vsetvli, vsetivli, or vsetvl before this instruction.
VMSEQ.VI performs element-wise equality immediate comparison and writes active-element Boolean results to the destination mask.
VMSEQ.VI is a RISC-V V-extension vector-immediate integer predicate-generation instruction. Within the current vl body elements, it compares vs2[i] with the sign-extended 5-bit immediate; vm=1 lets all body elements participate, while vm=0 processes only elements selected by v0.t. The result is written to vd in mask-register layout, one bit per element index; integer compares do not set floating-point exception flags.
Starts from OP-V encoding, then shows how integer equal with immediate comparison reads active elements and produces a one-bit-per-element predicate mask.
This animation shows only the ISA-visible comparison, execution-mask, and destination-mask writeback relationship; inactive and tail elements are not simulated as fixed data values here.
VMSEQ.VI does not write an ordinary integer vector; it writes each active element's equality immediate comparison result as one bit of the destination mask. The animation starts from OP-V encoding fields, decodes the vector-immediate operands, then shows per-lane comparison and vd.mask writeback.
When reading VMSEQ.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 «vmseq.vi v1, v2, 0».
Understand this scenario with real code like «vmseq.vi v1, v2, 0».
The result is written in mask-register layout, one predicate bit per active element, not ordinary SEW-wide vector elements such as 0/1 or 0/-1.
The immediate field is a 5-bit signed imm, sign-extended to SEW first; unsigned compares then apply the unsigned relation to that extended SEW bit pattern.
No. vm only selects which body elements are active; active elements still use this instruction-specific comparison relation to generate mask bits.