How does VMSIF.M differ from VMSBF.M?
VMSIF.M includes the first position; VMSBF.M excludes it.
Set mask positions up to and including the first active set bit
VMSIF.M scans the vs2 source mask, finds the first active set element, writes 1 to active positions up to and including that first, and writes 0 to later active positions. If no active source bit is set, every active destination bit is written with 1.
Starts from OP-V encoding fields, then shows how VMSIF.M sets positions up to and including the first active set bit.
The teaching model fixes vstart=0. VMSIF.M raises an illegal-instruction exception for nonzero vstart, so no ordinary nonzero-vstart execution path is shown.
Teaching context: SEW=8, LMUL=m1, VLEN=4096, VLMAX=512, vstart=0, valid vtype, and enabled VS; only body elements are shown. With no active source set bit, every active result bit is 1. x marks unspecified masked-off values; destination tails are always agnostic, while VL=0 updates nothing, including tails. With vm=0 and vs2=v0, source and execution-mask bits must match.
vmsif.m uses OP-V encoding; the vs1 field is fixed to 00011, and vs1 is not a syntax operand.
This animation shows only ISA-visible relationships from the official V extension: OP-V field decode, active mask-bit scan within vl, and destination mask-bit writeback. It does not model pipelines, caches, or timing.
VMSIF.M generates an inclusive prefix mask: the first position itself is also set.
Syntax: vmsif.m vd, vs2[, v0.t]; omit v0.t for vm=1, include it for vm=0. vd is one mask register: bit i corresponds to element i, independent of SEW/LMUL.
32-bit OP-V: opcode=1010111, funct6=010100, funct3=010 (OPMVV), with vs1 fixed to 00011.
Search active source bits only. Active destination positions through the first active set source bit become 1; later active positions become 0. If none is found, every active result bit becomes 1. Nonzero vstart raises illegal-instruction, with trap vstart=0.
vd cannot overlap vs2; with vm=0, vd cannot be v0. vs2=v0 is legal; with vm=0, source and execution-mask bits must match.
Require RV32/RV64 V 1.0, enabled VS, valid vtype and supported SEW; vstart=0. Inactive follows vma; mask tails are always agnostic. vl=0 updates no destination bits, including tails. The animation fixes m1, VLEN=4096, vstart=0 and shows body elements only; steps are not processor cycles.
Assume RV32/RV64 V 1.0, enabled VS, valid e32,m1, VLEN≥128, vl=4, vstart=0, and initialized sources; the example is unmasked. v0.mask[0..3]=[0,0,1,0] → v1.mask[0..3]=[1,1,1,0]. Only mask bits are written; tails are always agnostic without assumed zeroing.
Assume RV32/RV64 V 1.0, enabled VS, valid e32,m1, VLEN≥128, vl=4, vstart=0, and initialized sources; the example is unmasked. v0.mask[0..3]=[0,0,1,0] → v1.mask[0..3]=[1,1,1,0]. Only mask bits are written; tails are always agnostic without assumed zeroing.
VMSIF.M includes the first position; VMSBF.M excludes it.
With no active source set bit, each active destination bit becomes 1. With VL=0, every destination bit remains unchanged, including tails.