Test bit and branch if nonzero
This instruction compares the value of a bit in a general-purpose register with zero, and conditionally branches to a label at a PC-relative offset if the comparison is not equal. It provides a hint that this is not a subroutine call or return. This instruction does not affect condition flags.
31 | 30 | 29 | 28 | 27 | 26 | 25 | 24 | 23 | 22 | 21 | 20 | 19 | 18 | 17 | 16 | 15 | 14 | 13 | 12 | 11 | 10 | 9 | 8 | 7 | 6 | 5 | 4 | 3 | 2 | 1 | 0 |
0 | 1 | 1 | 0 | 1 | 1 | 1 | |||||||||||||||||||||||||
b5 | op | b40 | imm14 | Rt |
---|
constant integer t = UInt(Rt); constant integer datasize = 32 << UInt(b5); constant integer bit_pos = UInt(b5:b40); constant bits(64) offset = SignExtend(imm14:'00', 64);
constant bits(datasize) operand = X[t, datasize]; constant boolean branch_conditional = TRUE; if operand!= '0' then BranchTo(PC64 + offset, BranchType_DIR, branch_conditional); else BranchNotTaken(BranchType_DIR, branch_conditional);