NOP

RISC-V NOP Instruction Details

Instruction ManualI-type (HINT)

No operation; a HINT instruction encoded as ADDI x0, x0, 0

Instruction Syntax

nop
Operand Breakdown
This is a I-type (HINT)-format instruction. Confirm operand positions based on the assembly syntax.
RV32ISystemHINT

Instruction Encoding

31..20
imm[11:0]
19..15
rs1
14..12
funct3
11..7
rd
6..0
opcode

NOP uses opcode 0010011 (0x13), funct3 000. The rs1 field selects the source register, the 12-bit immediate provides the second operand, and rd selects the destination.

Format: I-type
opcode: 0010011 (0x13)
funct3: 000 (0x0)

Instruction Behavior

NOP is an assembler pseudo-instruction encoded as ADDI x0, x0, 0 (opcode=0010011, funct3=000, rd=x0, rs1=x0, imm=0). Since x0 is hardwired to zero and unwritable, this instruction changes no architectural state and produces no side effects. NOP occupies the HINT instruction space, used for pipeline padding, code alignment, or replacing disabled instructions. Other encodings besides ADDI x0,x0,0 also serve as NOPs (e.g., ADDI x0,x0,1), but the canonical NOP uses the all-zero immediate.

Common Usage Scenarios

Pipeline padding and code alignment

Understand this scenario with real code like «nop # encoded as addi x0, x0, 0».

Replace disabled instructions (nopout)

Understand this scenario with real code like «nop # encoded as addi x0, x0, 0».

Placeholder for performance profiling

Understand this scenario with real code like «nop # encoded as addi x0, x0, 0».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is I-type (HINT).
  • Confirm the operand order matches the example.
Semantic Check
  • Ensure the destination register usage is compatible with the calling convention.
  • Confirm this is not the lower-level form of a pseudo-instruction expansion.

Pitfalls / Common Confusions

NOP is a pseudo-instruction encoded as ADDI x0, x0, 0 — not visible in disassembly
Although it changes no architectural state, it consumes fetch bandwidth and pipeline resources
rd=x0 means the result is discarded; x0 is always 0