Encoding:

EXTEND

11110

offset 10:5

offset 15:11

LWSP

10010

rx

0

000

offset 4:0

5

6

5

5

3

3

5

Format:

LW rx, offset(sp)

MIPS16e

Load Word (SP-Relative, Extended)

Purpose:

Load Word (SP-Relative, Extended)

To load an SP-relative word from memory as a signed value.

Description:

GPR[rx] = memory[GPR[sp] + offset]

The 16-bit offsetis sign-extended and then added to the contents of GPR 29 to form the effective address. The contents of the word at the memory location specified by the e fective address are loaded into GPR rx.

Restrictions:

The effective address must be naturally-aligned. If either of the 2 least-significanbits of the address is non-zero, an

Address Error exception occurs.

Operation:

vAddr = sign_extend(offset) + GPR[29]
if vAddr1..0 != 02 then
   SignalException(AddressError)
endif
(pAddr, CCA) = AddressTranslation (vAddr, DATA, LOAD)
memword = LoadMemory (CCA, WORD, pAddr, vAddr, DATA)
GPR[Xlat(ry)] = memword

Exceptions:

TLB Refill, TLB I valid, Bus Error, Address Error