Webcentive RISC-V Reference

c.mv

Move Register

Extension
C
XLEN
RV32 and RV64
Assembly (riscv-unified-db)
c.mv xd, xs2
Length
16-bit (compressed)

Encoding

1513121176210
1000rd≠0rs2≠010

Match 0x8002, mask 0xf003. Source: c.mv rd_n0 c_rs2_n0 1..0=2 15..13=4 12=0 in riscv-opcodes/extensions/rv_c.

FieldBitsriscv-opcodes name
rd≠011:7rd_n0
rs2≠06:2c_rs2_n0

Description

C.MV (move register) performs copy of the data in register xs2 to register xd C.MV expands to add xd, x0, xs2.

Description from riscv-unified-db, reformatted.

Operation

if (implemented?(ExtensionName::C) && MISA_CSR_IMPLEMENTED && (CSR[misa].C == 1'b0)) {
  reserved_instruction($encoding);
}

X[xd] = X[xs2];

Pseudocode in riscv-unified-db’s IDL, quoted unchanged.

Specification and related pages