Branch if FP condition flag 0 is true : Branches to 'label' if Coprocessor 1 condition flag 0 is true (1). Set by a preceding FP compare instruction such as 'c.eq.s' or 'c.lt.d'. Note: mnemonic is BC1T (branch Coprocessor-1 True), not BCLT.
bc1t
Operands
[id / imm], idVariants
- Branch if FP condition flag 0 is true : Branches to 'label' if Coprocessor 1 condition flag 0 is true (1). Set by a preceding FP compare instruction such as 'c.eq.s' or 'c.lt.d'. Note: mnemonic is BC1T (branch Coprocessor-1 True), not BCLT. bc1t label
- Branch if specified FP condition flag is true : Branches to 'label' if the FP condition flag specified by the immediate operand is true (1). Allows branching on any of the 8 condition flags set by FP compare instructions. bc1t 1,label
.data
less: .float 1.0
greater: .float 2.0
.text
# Compare 1.0 and 2.0, then the reverse. A taken branch skips the assignment of 1; inspect $t2/$t3 for markers 2 (taken) and 1 (fall-through).
l.s $f0, less
l.s $f2, greater
c.lt.s $f0, $f2
li $t2, 0
bc1t 0, first_taken
li $t2, 1
b first_done # Skip the other marker unconditionally.
first_taken: li $t2, 2
first_done:
c.lt.s $f2, $f0
li $t3, 0
bc1t 0, second_taken
li $t3, 1
b second_done # Skip the other marker unconditionally.
second_taken: li $t3, 2
second_done: