How does VMV.S.X handle masking?
It fixes vm=1 and vs2=0; vm=0 encodings are reserved and there is no v0.t. VMERGE selects sources under v0 for all body elements, so it is not equivalent to this single-element transfer.
Move integer scalar x[rs1] into vector element 0.
VMV.S.X is a RISC-V V integer scalar-to-vector-element move. It writes x[rs1] to vd[0], rather than broadcasting to a whole vector or accessing memory. When SEW is below XLEN it copies the low SEW bits; when SEW exceeds XLEN it sign-extends the scalar to SEW bits.
Starts from OP-V field decode and shows when an integer scalar writes vector element 0.
Fixed vm and vs2 fields appear only in the encoding area below; they are not assembly syntax operands.
Teaching context: VLEN=4096 and support for the selected SEW. LMUL and register groups are ignored; only element 0 is shown. Steps are not processor cycles.
When a write occurs, elements 1 through VLEN/SEW−1 of the single destination register follow vta: retain old values or permit all ones. With vstart≥vl the entire destination is unchanged. On successful completion, vstart resets to 0.
The fixed OP-V fields identify the scalar-to-element-0 form: vm=1 and vs2=00000; masked vm=0 encodings are reserved.
VMV.S.X writes an integer scalar to vd[0]. It performs no arithmetic, accesses no memory, and does not broadcast to the whole vector.
vd is one vector register and rs1 is an integer x register; LMUL and register groups are ignored.
32-bit OP-V: opcode=1010111, funct6=010000, funct3=110, vm=1, vs2=00000; no v0.t operand.
When vstart<vl, write vd[0]: XLEN>SEW takes low bits, XLEN<SEW sign-extends, and x0 supplies zero. Other elements of the register follow vta.
vstart≥vl (including vl=0) updates no destination elements; successful completion resets vstart to 0. Require V 1.0, valid supported vtype and non-Off mstatus.VS; with H and virtualization V=1, vsstatus.VS must also be non-Off.
Assume enabled V/VS, valid e8,m1, VLEN≥128, vl=4 and vstart=0; XLEN=64, x10=0x123456789abcdef0 → v8[0]=0xf0. Other elements of the single register follow vta. Tails are not assumed zero; vl=0 leaves the whole destination unchanged.
Assume enabled V/VS, valid e8,m1, VLEN≥128, vl=4 and vstart=0; XLEN=64, x10=0x123456789abcdef0 → v8[0]=0xf0. Other elements of the single register follow vta. Tails are not assumed zero; vl=0 leaves the whole destination unchanged.
It fixes vm=1 and vs2=0; vm=0 encodings are reserved and there is no v0.t. VMERGE selects sources under v0 for all body elements, so it is not equivalent to this single-element transfer.