C.ADDI4SPN
Compressed Add Immediate to Stack Pointer (Non-zero)
C.ADDI4SPN rd', uimm
Adds a zero-extended non-zero immediate to the stack pointer (x2) and stores the result in a register.
Details
Adds a zero-extended non-zero immediate to sp (x2) and writes the result to rd′ (CIW format). Used to address stack-allocated data.
Pseudocode Operation
R[rd'] = R[2] + zext(uimm);
Example
C.ADDI4SPN x8, 16
Encoding
Binary Layout
000
15:13
uimm
rd'
12:10
00
9:8
Operands
-
rd'
Dest (x8-x15) -
uimm
Unsigned immediate value