c.mv

Move Register

This instruction is defined by:

  • anyOf:

    • C, version >= 0

    • Zca, version >= 0

This instruction is included in the following profiles:

Encoding

svg

Assembly format

c.mv rd, rs2

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

  • IDL

  • Sail

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

Exceptions

This instruction may result in the following synchronous exceptions:

  • IllegalInstruction