lis
Load Immediate Shifted
Loads a 16-bit immediate into the upper half of a 32-bit word. (Alias for 'addis RT, 0, SIM').
Details
The 'lis' instruction loads an immediate value shifted left by 16 bits into a register. If the source register (RA) is zero, it uses the value 0; otherwise, it adds the contents of RA to the sign-extended immediate value.
Pseudocode Operation
if RA = 0 then
RT ← EXTS(SI || 160)
else
RT ← (RA) + EXTS(SI || 160)
Programming Note
The 'lis' instruction is commonly used to load large constants into a register by shifting the immediate value left by 16 bits. If the source register (RA) is not zero, its contents are added to the sign-extended immediate value. Be cautious with alignment as this can affect performance and correctness. This instruction operates at user privilege level.
Example
Encoding
Operands
-
RT
Target -
SIM
Immediate