C.BEQZ

Compressed Branch if Equal to Zero

C.BEQZ rs1', offset

Branches if the register is zero.

Encoding

Binary Layout
?
31:16
110
15:13
c_bimm9hi
12:10
rs1_p
9:7
c_bimm9lo
6:2
01
1:0
 
Format CB
Opcode 0x0000C001
Extension C

Operands

  • rs1'
    Source
  • offset
    Target

Example

C.BEQZ x8, exit

// Jump if x8 is 0.

Related

More in C

Description

Branches to an 8-bit PC-relative offset if rs1′ equals zero.

Operation

if (R[rs1'] == 0) PC += sext(offset);