ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 1,823 microarchs · 16,083 chips · 105 sources
Arch:
Tier:

bnei

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

Summary

Branch to PC + offset if the value in register xs1 is not equal to the XLEN-bit comparison constant decoded from cimm.

Syntax / Encoding

bnei xs1, cimm, offset | xxxxxxxxxxxxxxxxx011xxxxx1100011 (mask=0x0000707f match=0x00003063)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
32RVxxxxxxxxxxxxxxxxx011xxxxx11000110x0000707f / 0x00003063

Operands

NameDescription
offsetbits [31,7,30:25,11:8], sign-extended, shifted << 1
cimmbits [24:20]
xs1bits [19:15]

Reference Notes

Branch to PC + offset if the value in register xs1 is not equal to the XLEN-bit
comparison constant decoded from cimm.

The cimm field is not sign-extended: cimm == 0 encodes the value -1, and
cimm values 1 through 31 encode the corresponding positive integer values.

Raise a `MisalignedAddress` exception if the branch is taken and PC + offset is
misaligned.