CBNZ, CBZ

Compare and Branch on Nonzero and Compare and Branch on Zero compare the value in a register with zero, and conditionally branch forward a constant value. They do not affect the condition flags.

T1

1514131211109876543210
1011op0i1imm5Rn

CBNZ (op == 1)

CBNZ{<q>} <Rn>, <label>

CBZ (op == 0)

CBZ{<q>} <Rn>, <label>

constant n = UInt(Rn); constant imm32 = ZeroExtend(i:imm5:'0', 32); constant nonzero = (op == '1'); if InITBlock() then UNPREDICTABLE;

For more information about the constrained unpredictable behavior, see Architectural Constraints on UNPREDICTABLE behaviors.

Assembler Symbols

<q>

See Standard assembler syntax fields.

<Rn>

Is the general-purpose register to be tested, encoded in the "Rn" field.

<label>

Is the program label to be conditionally branched to. Its offset from the PC, a multiple of 2 and in the range 0 to 126, is encoded as "i:imm5" times 2.

Operation

EncodingSpecificOperations(); if nonzero != IsZero(R[n]) then CBWritePC(PC32 + imm32);


Internal version only: isa v01_31, pseudocode v2024-03_rel ; Build timestamp: 2024-03-25T10:05

Copyright © 2010-2024 Arm Limited or its affiliates. All rights reserved. This document is Non-Confidential.