c.beqz
Branch if Equal Zero
This instruction is defined by:
Synopsis
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 rs1' is zero.
It expands to beq rs1, x0, offset
.
Decode Variables
Bits<8> imm = {$encoding[12], $encoding[6:5], $encoding[2], $encoding[11:10], $encoding[4:3]};
Bits<3> rs1 = $encoding[9:7];
Execution
-
Pruned, XLEN == 64
-
Original
if (X[rs1] != 0) {
jump($pc + imm);
}
if (implemented?(ExtensionName::C) && (CSR[misa].C == 1'b0)) {
raise(ExceptionCode::IllegalInstruction, mode(), $encoding);
}
if (X[rs1] != 0) {
jump($pc + imm);
}