Webcentive RISC-V Reference

c.nop

Non-operation

Extension
C
XLEN
RV32 and RV64
Assembly (riscv-unified-db)
c.nop imm
Length
16-bit (compressed)

Encoding

1513121176210
000nzimm[5]00000nzimm[4:0]01

Match 0x0001, mask 0xef83. Source: c.nop c_nzimm6hi c_nzimm6lo 1..0=1 15..13=0 11..7=0 in riscv-opcodes/extensions/rv_c.

FieldBitsriscv-opcodes name
nzimm[5]12c_nzimm6hi
nzimm[4:0]6:2c_nzimm6lo

Description

C.NOP does not change any user-visible state, except for advancing the pc and accepting any HINTs. C.NOP expands into addi x0, x0, 0. C.NOP with non-zero immediate values are HINTs.

Description from riscv-unified-db, reformatted.

Operation

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

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

Specification and related pages