paddi
Prefixed Add Immediate
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
Encoding
Operands
-
RT
Target -
RA
Src -
SI
Imm -
R
PC-Rel