paddi

Prefixed Add Immediate

paddi RT, RA, SI, R

Adds 34-bit immediate.

Encoding

Binary Layout
1
0:5
2
6:7
R
8
0
9:13
D0
14:31
14
32:37
RT
38:42
RA
43:47
D1
48:63
 
Format MLS:D-form
Opcode 0x0600000038000000
Extension Prefixed

Operands

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

Example

paddi r3, r4, 16, 0

Related

More in Prefixed

Reference

Description

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.

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.