Encoding:

SLTIU32

101100

rt

rs

immediate

6

5

5

16

Format:

SLTIU rt, rs, immediate 

microMIPS

Set on Less Than Immediate Unsigned

Purpose:

Set on Less Than Immediate Unsigned

To record the result of an unsigned less-than comparison with a constant.

Description:

 GPR[rt] = (GPR[rs] < sign_extend(immediate))

Compare the contents of GPR rs and the sign-extended 16-bit immediate as unsigned integers; record the Boolean result of the comparison in GPR rt. If GPR rs is less than immediate, the result is 1 (true); otherwise, it is 0 (false).

Because the 16-bit immediate is sign-extended before comparison, the instruction can represent the smallest or largest unsigned numbers. The representable values are at the minimum [0, 32767] or maximum [max_unsigned-32767, max_unsigned] end of the unsigned range.

The arithmetic comparison does not cause an Integer Overflow exception.

Restrictions:

None

Operation:

if (0 || GPR[rs]) < (0 || sign_extend(immediate)) then
   GPR[rt] = 0GPRLEN-1 || 1
else
   GPR[rt] = 0GPRLEN
endif

Exceptions:

None