RISC-V mv Pseudo-Instruction Details
Assembler pseudo-instructionRegister-to-register copy pseudo-instruction, expands to addi rd, rs, 0. Expresses assignment semantics more clearly than raw ADDI. Heavily used by compilers for register allocation, function argument setup, and temporary value preservation.
What This Pseudo Instruction Is Saving You From Writing
Improves readability by expressing assignment/move intent more clearly than raw addi rd, rs, 0. mov is one of the most common IR operations in compilers.
Official Semantics Checklist
How To Read The Expansion
What You May See In objdump / Disassembly
Official References And Reading Order
This page treats pseudo-instructions as assembler-level aliases or macros: first read what real instructions they expand to, then use the official ISA manual for the behavior of those real instructions. ABI, relocation, and linker-relaxation details follow the psABI document.
When To Think Of It First
Pitfalls / Common Confusions
FAQ
Is mv a real RISC-V instruction?
mv is an assembler pseudo-instruction or alias, not a separate hardware opcode. The “Typical Real Expansion” section lists the official expansion, and behavior is defined by the expanded ISA instructions.
What is the main trap when using mv?
MV is a pure data copy — unlike seqz/snez, it does not check zero or sign