addis
Add Immediate Shifted
Adds an immediate value shifted left by 16 bits to the contents of a register and places the result in another register.
Details
The addis instruction adds an immediate value, which is shifted left by 16 bits, to the contents of register RA. The sum is placed into register RT.
Pseudocode Operation
if RA = 0 then
RT ←EXTS(SI || 160)
else
RT ←(RA) + EXTS(SI || 160)
Programming Note
The addis instruction is commonly used for loading large immediate values into a register by shifting the 16-bit immediate value left by 16 bits and adding it to the contents of another register. If RA is zero, the instruction effectively sign-extends the immediate value and places it in RT. This instruction does not require any special privileges and can be used at any privilege level. However, developers should ensure that the immediate value does not cause overflow when shifted and added, as this could lead to unexpected results.
Extended Mnemonics
| Extended Mnemonic | Equivalent Instruction |
|---|---|
| lis | |
| subis |
Example
Encoding
Operands
-
RT
Target Register -
RA
Source Register (0 means 0) -
SI
Signed 16-bit Immediate -
SIMM
16-bit signed immediate value shifted left by 16 bits