c.mv

Move Register

This instruction is defined by:

Encoding

svg

Synopsis

C.MV (move register) performs copy of the data in register rs2 to register rd C.MV expands to addi rd, x0, rs2.

Access

M

HS

U

VS

VU

Always

Always

Always

Always

Always

Decode Variables

Bits<5> rd = $encoding[11:7];
Bits<5> rs2 = $encoding[6:2];

Execution

  • Pruned, XLEN == 64

  • Original

X[rd] = X[rs2];
if (implemented?(ExtensionName::C) && (CSR[misa].C == 1'b0)) {
  raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
}
X[rd] = X[rs2];