EXTEND 11110 |
Imm[10:5] |
Imm[15:11] |
LWSP 10010 |
rx |
sel = 1 |
Imm[4:0] |
5 |
5 |
5 |
5 |
5 |
3 |
3 |
LW rx, immediate(gp) |
MIPS16e2 |
Load Word (GP-Relative, Extended) |
Load Word (GP-Relative, Extended)
To load a GP-relative word from memory as a signed value.
GPR[rx] = memory[GPR[gp] + immediate]
The 16-bit immediate value is sign-extended, then added to the contents of GPR 28 to form the effective address. The contents of the word at the memory location specified by the effective address are loaded into GPR rx.
Unpredictable prior to MIPS16e2. The effective address must be naturally-aligned. If either of the 2 least-significant bits of the address is non-zero, an Address Error exception occurs.
vAddr = sign_extend(immediate) + GPR[28] if vAddr1..0 != 02 then SignalException(AddressError) endif (pAddr, CCA) = AddressTranslation (vAddr, DATA, LOAD) memword = LoadMemory (CCA, WORD, pAddr, vAddr, DATA) GPR[Xlat(rx)] = memword
TLB Refill, TLB Invalid, Bus Error, Address Error