← Home

c.beqz

Branch if Equal Zero

C.BEQZ 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.BEQZ takes the branch if the value in register xs1' is zero. It expands to `beq` `xs1, x0, offset`.

Assembly format

c.beqz xs1, imm

Encoding

1514131211109876543210
110immxs1imm01

Decode variables

VariableBitsWidth
imm[12], [6:5], [2], [11:10], [4:3]8
xs1[9:7]3

Execution

if (implemented?(ExtensionName::C) && MISA_CSR_IMPLEMENTED && (CSR[misa].C == 1'b0)) {
  reserved_instruction($encoding);
}
if (X[creg2reg(xs1)] == 0) {
  jump($pc + $signed(imm));
}

Defined by

Zca

Access

SUVSVU
AlwaysAlwaysAlwaysAlways

Version af3eaf9+cheriot.f635218

Data from the RISC-V Unified Database, copyright RISC-V International and contributors.

CHERIoT extensions from the CHERIoT specification and Sail model, copyright Microsoft and the CHERIoT Platform contributors.

This site is provided as a community resource and is NOT affiliated with nor endorsed by RISC-V International.