vmv.x.s
Vector move scalar to integer register
- Extension
- V
- XLEN
- RV32 and RV64
- Assembly (riscv-unified-db)
vmv.x.s xd, vs2- Length
- 32-bit
Encoding
| 3126 | 25 | 2420 | 1915 | 1412 | 117 | 60 | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 010000 | 1 | vs2 | 00000 | 010 | rd | 1010111 | |||||||||||||||||||||||||
Match 0x42002057, mask 0xfe0ff07f. Source: vmv.x.s 31..26=0x10 25=1 vs2 19..15=0 14..12=0x2 rd 6..0=0x57 in riscv-opcodes/extensions/rv_v.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| vs2 | 24:20 | vs2 |
| rd | 11:7 | rd |
Description
Copies the first element of the source vector register vs2 to the destination integer register xd, sign-extending to XLEN bits if SEW < XLEN.
This is a scalar read instruction that always reads element 0 of vs2, regardless of vstart. The vstart CSR is reset to 0 after execution.
Description from riscv-unified-db, reformatted.
Operation
VectorState state = vector_state(); # vmv.x.s copies element 0 of vs2 to xd, sign-extending to XLEN X[xd] = $signed(V[vs2][state.sew-1:0]); CSR[vstart].VALUE = 0;
Pseudocode in riscv-unified-db’s IDL, quoted unchanged.