sltu

Operands

$reg, $reg, $reg

Set on less than unsigned : Sets $t1 = 1 if $t2 < $t3 using unsigned comparison, otherwise $t1 = 0. Treats both operands as unsigned 32-bit integers (0 to 4294967295). Use this when comparing memory addresses or unsigned counters.

Variants

  • Set on less than unsigned : Sets $t1 = 1 if $t2 < $t3 using unsigned comparison, otherwise $t1 = 0. Treats both operands as unsigned 32-bit integers (0 to 4294967295). Use this when comparing memory addresses or unsigned counters. sltu $t1,$t2,$t3
# Compare signed and unsigned bit patterns: $t0 is -1 (0xFFFFFFFF), $t1 is 1. Inspect $t2: 0.
li $t0, -1
li $t1, 1
sltu $t2, $t0, $t1