movn

Operands

$reg, $reg, $reg

Move if not zero : Copies $t2 into $t1 only if $t3 != 0. Allows branchless conditional assignment — avoids a branch instruction when you only need to update a register conditionally.

Variants

  • Move if not zero : Copies $t2 into $t1 only if $t3 != 0. Allows branchless conditional assignment — avoids a branch instruction when you only need to update a register conditionally. movn $t1,$t2,$t3
# Set condition to make movn copy its source. Inspect $t2: 7.
li $t1, 7
li $t0, 1
movn $t2, $t1, $t0