Webcentive RISC-V Reference

c.not

Bitwise not, 16-bit encoding

Extension
Zcb
XLEN
RV32 and RV64
Assembly (riscv-unified-db)
c.not xd
Length
16-bit (compressed)

Encoding

1513121097654210
100111rs1′/rs2′1110101

Match 0x9c75, mask 0xfc7f. Source: c.not rd_rs1_p 1..0=1 15..13=4 12..10=7 6..5=3 4..2=5 in riscv-opcodes/extensions/rv_zcb.

FieldBitsriscv-opcodes name
rs1′/rs2′9:7rd_rs1_p

Description

Takes a single source/destination operand. This instruction takes the one's complement of xd'/xs1' and writes the result to the same register.

Description from riscv-unified-db, reformatted.

Operation

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

X[creg2reg(xd)] = ~X[creg2reg(xd)];

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

Specification and related pages