c.addi4spn

Adds a zero-extended non-zero immediate, scaled by 4, to the stack pointer, x2, and writes the result to rd'. This instruction is used to generate pointers to stack-allocated variables. It expands to `addi rd', x2, nzuimm[9:2]`. C.ADDI4SPN is only valid when nzuimm ≠ 0; the code points with nzuimm=0 are reserved.

Synopsis

c.addi4spn xd, sp, imm

Encoding

Type:

0124567101112131500xdimmimmimmimm000

RISC-V Instruction Encoder/Decoder

open c.addi4spn in rvcodecjs

Availability