bnez

RISC-V bnez Pseudo-Instruction Details

Assembler pseudo-instruction

The RISC-V bnez pseudo-instruction has the bnez expansion BNE rs, x0, offset and branches if the register is not equal to zero. Its conditional branch range is plus or minus 4 KiB.

What You Write
bnez rs, offset
Typical Real Expansion
bne rs, x0, offset

What This Pseudo Instruction Is Saving You From Writing

Assembly Manual lists this pseudo-instruction form.

How To Read The Expansion

Step 1
Assembly Manual expands bnez rs, offset to bne rs, x0, offset.

Assembly Forms And Real Instructions

The RISC-V Assembly Programmer's Manual lists bnez as BNE rs, x0, offset.

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.

FAQ

What does bnez expand to?

the RISC-V Assembly Programmer's Manual gives bnez rs, offset as bne rs, x0, offset.