RISC-V not Pseudo-Instruction Details
Assembler pseudo-instructionBitwise NOT pseudo-instruction, expands to xori rd, rs, -1. Flips every bit of register rs (0→1, 1→0) and stores in rd. Common for bitmask generation, bit clearing, and logic operations.
What This Pseudo Instruction Is Saving You From Writing
More natural than xori rd, rs, -1. Exploits XOR with all-ones property — any bit XOR 1 flips — to concisely implement NOT.
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 not a real RISC-V instruction?
not 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 not?
NOT acts on the whole register width (RV32=32 bits, RV64=64 bits), so match it to the intended data width