movt

Move if FP condition true

Copies $t2 into $t1 if the FP condition flag (flag 0 by default) is true.

Forms

  • movt ,
  • movt , ,

    Copies $t2 into $t1 if FP condition flag N (specified by the third operand) is true (1). Allows results of multiple simultaneous FP comparisons to control integer register moves.

Operands

$t1
Any general-purpose register, $0 to $31, using its numeric or named spelling, such as $8 or $t0 ($zero is $0; $ra is $31).
$t2
A general-purpose register. It may be the same register as $t1.
cc
A floating-point condition flag number, 0 to 7. Comparisons set these flags; bc1t and bc1f test them.

Allows integer register updates to be conditioned on the result of a previous FP comparison (e.g., c.eq.s, c.lt.s).

.data
a: .float 1.0
b: .float 2.0
.text
# movt reads condition flag 0; set it true, then inspect $t2: 7 after the conditional copy.
l.s $f0, a
l.s $f2, b
c.lt.s $f0, $f2
li $t1, 7
li $t2, 0
movt $t2, $t1, 0