TBZ

Branches, exception generating and system instructions

fixed bit field field the encoding fixes should be

Branch conditional test

313029282726252423222120191817161514131211109876543210
b50110110b40imm14Rt
op

x0110110xxxxxxxxxxxxxxxxxxxxxxxx

Decode Sail

let 't = UInt(Rt);
let 'datasize = if b5 == 0b1 then 64 else 32;
let 'bit_pos = UInt(b5 @ b40);
let bit_val : bits(1) = op;
let offset : bits(64) = SignExtend(imm14 @ 0b00, 64);
execute_aarch64_instrs_branch_conditional_test(bit_pos, bit_val, datasize, offset, t)

Operation Sail

let operand : bits('datasize) = X_read(t, datasize);
let branch_conditional : bool = true;
assert(constraint('bit_pos < 'datasize));
if [operand[bit_pos]] == bit_val then {
    BranchTo(PC_read() + offset, BranchType_DIR, branch_conditional)
} else {
    BranchNotTaken(BranchType_DIR, branch_conditional)
}

Made from ScarletNX's Sail at 166ad3910f80. sail-arm's definitions are Arm's ASL in Sail (BSD 3-Clause Clear, license); ScarletNX's fixups are GPL-3.0-or-later.