Check vl first
The current vl determines the number of body elements. Typical code executes vsetvli, vsetivli, or vsetvl before this instruction.
Load ceil(vl/8) contiguous bytes from x[rs1] and write the packed bits into the destination mask register.
VLM.V is the RISC-V V extension unit-stride mask load. It reads a packed mask representation as bytes, with an access size of ceil(vl/8) bytes; mask bit i comes from bit i mod 8 of byte floor(i/8). The instruction loads mask bits, not ordinary vector data elements using the current SEW.
Decode the packed mask load, then compute each element address as x[rs1] + floor(i/8).
The animation starts from the 32-bit vector memory encoding and shows the official bit fields: nf, mew, mop, vm, rs2/vs2 or lumop/sumop, width, register fields, and opcode.
VLM.V restores a packed bitmap from memory into a mask register: with VL=16 it reads only 2 bytes, one bit per lane.
When reading VLM.V, do not stop at the mnemonic. Official V-extension semantics also depend on the current vl, vtype, and mask state. The suffix and operand form determine whether sources are vector, scalar, or immediate values.
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 «vlm.v v0, (a0) # load ceil(vl/8) packed mask bytes».
Understand this scenario with real code like «vlm.v v0, (a0) # load ceil(vl/8) packed mask bytes».
Understand this scenario with real code like «vlm.v v0, (a0) # load ceil(vl/8) packed mask bytes».
No. It loads packed mask bytes and maps each bit to one mask element.
Because each mask element occupies one bit, so VL mask bits are rounded up to a whole number of bytes.