ISARef Multi-ISA & Silicon Reference
45,419 ISA items · 105,907 timings · 913 microarchs · 15,555 chips · 105 sources
Arch:
Tier:

c.addi16sp

T1 riscv alu insn
Add a sign-extended non-zero immediate
SourceRISC-V Official Unified Database (riscv-unified-db) (riscv_unified_db)
Reliability TierT1 — Official Specification
ISA / Silicon ScopeRV32/RV64 Zca
RV32 / RV64 (Ratified & Standard Extensions)
License & VersionApache-2.0 / CC-BY-4.0
main
Upstreamhttps://github.com/riscv/riscv-unified-db
Privilegeuser
ExtensionsZca

Summary

C.ADDI16SP adds the non-zero sign-extended 6-bit immediate to the value in the stack pointer (sp=x2), where the immediate is scaled to represent multiples of 16 in the range (-512,496). C.ADDI16SP is used to adjust the stack pointer in procedure prologues and epilogues. It expands into addi x2, x2, nzimm[9:4]. C.ADDI16SP is only valid when nzimm ≠ 0; the code point with nzimm=0 is reserved.

Syntax / Encoding

c.addi16sp sp, imm | 011x00010xxxxx01 (mask=0xef83 match=0x6101)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
16RV011x00010xxxxx010xef83 / 0x6101

Operands

NameDescription
immbits [12,4:3,5,2,6], sign-extended, shifted << 4, not 0

Reference Notes

C.ADDI16SP adds the non-zero sign-extended 6-bit immediate to the value in the stack pointer (sp=x2), where the immediate is scaled to represent multiples of 16 in the range (-512,496).
C.ADDI16SP is used to adjust the stack pointer in procedure prologues and epilogues.
It expands into `addi x2, x2, nzimm[9:4]`.
C.ADDI16SP is only valid when nzimm &ne; 0; the code point with nzimm=0 is reserved.