EXTEND 11110 |
Imm[10:5] |
Imm[15:11] |
LWSP 10010 |
rx |
sel = 2 |
Imm[4:0] |
5 |
5 |
5 |
5 |
5 |
3 |
3 |
LH rx, immediate(gp) |
MIPS16e2 |
Load Halfword (GP-relative) Extended |
Load Halfword (GP-relative) Extended
To load a halfword 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 halfword at the memory location specified by the effective address are sign-extended and loaded into
GPR rx.
Unpredictable prior to MIPS16e2. The effective address must be naturally-aligned. If the least-significant bit of the address is non-zero, an Address Error exception occurs.
vAddr = sign_extend(immediate) + GPR[28] if vAddr0 != 0 then SignalException(AddressError) endif (pAddr, CCA) = AddressTranslation (vAddr, DATA, LOAD) pAddr = pAddrPSIZE-1..2 || (pAddr1..0 xor (ReverseEndian || 0)) memword = LoadMemory (CCA, HALFWORD, pAddr, vAddr, DATA) byte = vAddr1..0 xor (BigEndianCPU || 0) GPR[Xlat(rx)] = sign_extend(memword15+8*byte..8*byte)
TLB Refill, TLB Invalid, Bus Error, Address Error