Encoding:

ADDIU32

001100

rt

rs

immediate

6

5

5

16

Format:

ADDIU rt, rs, immediate

microMIPS

Add Immediate Unsigned Word

Purpose:

Add Immediate Unsigned Word

To add a constant to a 32-bit integer.

Description:

GPR[rt] = GPR[rs] + immediate

The 16-bit signed immediate is added to the 32-bit value in GPR rs and the 32-bit arithmetic result is sign-extended and placed into GPR rt.

No Integer Overflow exception occurs under any circumstances.

Restrictions:

If GPR rs does not contain a sign-extended 32-bit value (bits 63..31 equal), then the result of the operation is

UNPREDICTABLE.

Operation:

if NotWordValue(GPR[rs]) then 
   UNPREDICTABLE 
endif
temp = GPR[rs] + sign_extend(immediate)
GPR[rt] = sign_extend(temp31..0)

Exceptions:

None

Programming Notes:

The term "unsigned" in the instruction name is a misnomer; this operation is 32-bit modulo arithmetic that does not trap on overflow. This instruction is appropriate for unsigned arithmetic, such as address arithmetic, or integer arithmetic environments that ignore overflow, such as C language arithmetic.