C.NOT

RISC-V C.NOT Instruction Details

Instruction ManualC-type

16-bit bitwise NOT (one's complement)

Instruction Syntax

c.not rsd'
Operand Breakdown
RV32/RV64 Zcb requiring Zca; 16-bit CU format.
The single three-bit rd'/rs1' field selects x8–x15 for both reading and writing.
No immediate or second source: invert all XLEN bits, equivalent to xori rd', rd', -1.
Overlapping sources read the same pre-writeback value; x0 is outside the encodable register subset.
ZcbCompressed Instruction

Instruction Behavior

C.NOT (Zcb, CU format) inverts all XLEN bits of read/write operand rsd' in x8–x15, equivalent to xori rsd', rsd', -1. Zcb requires Zca and supports RV32/RV64.

C.NOT Decode & Execute Animation

Shows only ISA-visible 16-bit encoding, operands, and state, not a pipeline, cache, or timing.

c.not
Execution context
x10 <- ~0x00FF00FF = 0xFF00FF00
16-bit encoding fields
15..10
funct6
100111
9..7
rd'/rs1'
010
6..5
funct2
11
4..2
C.NOT
101
1..0
op
01
Execution data path
Compressed operand mapping
rd'/rs1'=010 -> x(8+2)=x10; read values before writeback
Concrete calculation
The Calculate stage shows the equation for the current inputs.
Architectural result

Continue to Commit result to reveal architectural state.

Quick Understanding & Search Notes

C.NOT's single rd'/rs1' field maps to x8-x15 and computes XOR with -1 in that same register.

C.NOT has neither an immediate nor a second source register; its only operand is both source and destination.
Zcb requires Zca; C.NOT supports RV32/RV64, without an additional M or Zbb prerequisite.

Common Usage Scenarios

Compressed integer bit operations

RV32 Zcb+Zca, x10=0x00ff00ff: c.not x10 writes x10=0xff00ff00, flipping all 32 bits.

Pre-Use Checklist

Syntax Check
  • RV32/RV64 Zcb requiring Zca; 16-bit CU format.
  • The single three-bit rd'/rs1' field selects x8–x15 for both reading and writing.
Semantic Check
  • No immediate or second source: invert all XLEN bits, equivalent to xori rd', rd', -1.
  • Overlapping sources read the same pre-writeback value; x0 is outside the encodable register subset.

Pitfalls / Common Confusions

Operand limited to x8-x15
Equivalent to xori rd', rd', -1

FAQ

Does C.NOT perform arithmetic negation?

It flips all XLEN bits, equivalent to XOR with -1.

Can C.NOT select any register?

Only x8–x15; the single register is read/write, with no immediate.