VMV.X.S

RISC-V VMV.X.S Instruction Details

Instruction ManualR-type

Move vector element 0 into integer register rd.

Instruction Syntax

vmv.x.s rd, vs2
Operand Breakdown
Destination rd: register receiving the operation result.
Source rs1: register holding the first operand.
Source rs2: register holding the second operand.
VVector Data MovementScalar-Vector Transfer

Instruction Behavior

VMV.X.S is a RISC-V V vector-scalar move instruction. It transfers an integer bit pattern between a scalar register and vector element 0 only; it is not a full-vector broadcast or a memory access.

Quick Understanding & Search Notes

VMV instructions move or broadcast data; they do not perform arithmetic or access memory.

This instruction is an unmasked form with no extra v0 execution mask; destination element coverage is defined by the instruction and current vl.
Move instructions preserve or extend source bit patterns according to the source type.
Use vmerge forms for masked selection rather than adding an ordinary execution mask to vmv.

Common Usage Scenarios

Vector Init

Understand this scenario with real code like «vmv.x.s a0, v8».

Reduction Result

Understand this scenario with real code like «vmv.x.s a0, v8».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is R-type.
  • Confirm the operand order matches the example.
Semantic Check
  • Ensure the destination register usage is compatible with the calling convention.
  • Confirm this is not the lower-level form of a pseudo-instruction expansion.

Pitfalls / Common Confusions

Operates even if vl=0—always reads element 0
Sign-extends if SEW<XLEN

FAQ

How does VMV.X.S handle masking?

It has no ordinary v0 execution mask; if a mask operand appears in the syntax, that operand is data, not an extra execution mask.