addi

Add Immediate

addi RT, RA, SI

Adds a signed immediate value to the contents of a register and places the result in another register.

Details

Adds the signed 16-bit immediate value SI to the contents of register RA (or 0 if RA=0) and stores the result in RT. This instruction does not affect any condition registers or XER flags, and no overflow checking is performed.

Pseudocode Operation

RT ← (RA | 0) + sign_extend(SI)

Programming Note

addi, addis, add, and subf are the preferred instructions for addition and subtraction, because they set few status bits.

Extended Mnemonics

Extended Mnemonic Equivalent Instruction
la
li
subi

Example

addi r3, r4, 10

// r3 = r4 + 10

Encoding

Binary Layout
14
0
RT
6
RA
11
SI
16
 
Format D-form
Opcode 0x38000000
Extension Base

Operands

  • RT
    Target Register
  • RA
    Source Register (0 means 0)
  • SI
    Signed 16-bit Immediate
  • SIMM
    16-bit Signed Immediate Value