ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 913 microarchs · 15,555 chips · 105 sources
Arch:
Tier:

c.bnez

T1 riscv alu insn
Branch if NOT Equal Zero
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRV32/RV64 Zca
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
Privilegeuser
ExtensionsZca

Summary

C.BNEZ performs conditional control transfers. The offset is sign-extended and added to the pc to form the branch target address. It can therefore target a ±256 B range. C.BNEZ takes the branch if the value in register xs1' is NOT zero. It expands to bne xs1, x0, offset.

Syntax / Encoding

c.bnez xs1, imm | 111xxxxxxxxxxx01 (mask=0xe003 match=0xe001)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
16RV111xxxxxxxxxxx010xe003 / 0xe001

Operands

NameDescription
immbits [12,6:5,2,11:10,4:3], sign-extended, shifted << 1
xs1bits [9:7]

Reference Notes

C.BNEZ performs conditional control transfers. The offset is sign-extended and added to the pc to form the branch target address. It can therefore target a &pm;256 B range. C.BNEZ takes the branch if the value in register xs1' is NOT zero.
It expands to `bne` `xs1, x0, offset`.