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

The addi instruction adds a 16-bit signed integer (immediate) to the contents of source register RA, placing the result into target register RT. The immediate is sign-extended from 16 bits to 32 bits before being added.

Pseudocode Operation

if 'addi' then
    RT ←(RA|0) + EXTS64(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

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