EXTEND 11110 |
Imm[10:5] |
Imm[15:11] |
ADDIUSP 00000 |
rx |
sel = 1 |
Imm[4:0] |
5 |
5 |
0 |
5 |
5 |
3 |
3 |
5
ADDIU rx, gp, immediate |
MIPS16e2 |
Add Immediate Unsigned Word (3-Operand, GP-Relative, Extended) |
Add Immediate Unsigned Word (3-Operand, GP-Relative, Extended)
To add a constant to the global pointer.
GPR[rx] = GPR[gp] + immediate
The 16-bit immediate is sign-extended and then added to the contents of GPR 28 to form a 32-bit result. The result is placed in GPR rx.
No integer overflow exception occurs under any circumstances.
None
temp = GPR[28] + sign_extend(immediate) GPR[XLat[rx]] = temp
None
The term "unsigned" in the instruction name is a misnomer; this operation is 32-bit modulo arithmetic that does not trap on overflow. It is appropriate for unsigned arithmetic, such as address arithmetic, or integer arithmetic environments that ignore overflow, such as C language arithmetic.