paddi

Prefixed Add Immediate

paddi RT, RA, SI, R

Adds 34-bit immediate.

Details

Adds a 34-bit sign-extended immediate to RA (or 0 if RA=0) and stores the result in RT. The immediate is formed by concatenating prefix and suffix fields across a 64-bit prefixed instruction pair. When R=0, the offset is absolute; when R=1, it is PC-relative. This is a privileged Base extension instruction for 64-bit processors.

Pseudocode Operation

if R = 1 then
  RT ← (RA | 0 if RA=0) + sign_extend(SI, 34) + CIA
else
  RT ← (RA | 0 if RA=0) + sign_extend(SI, 34)

Programming Note

The paddi instruction is commonly used for loading addresses or small immediate values into registers. Be cautious with alignment; ensure that the immediate value does not cause overflow, which could lead to unexpected results. This instruction operates at user privilege level and does not generate exceptions under normal circumstances.

Example

paddi r3, r4, 16, 0

Encoding

Binary Layout
1
0
2
6
R
8
0
9
D0
14
14
32
RT
38
RA
43
D1
48
 
Format MLS:D-form
Opcode 0x0600000038000000
Extension Prefixed

Operands

  • RT
    Target
  • RA
    Src
  • SI
    Imm
  • R
    PC-Rel