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

c.swsp

T1 riscv alu insn
Store word to stack
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

Stores a 32-bit value in register xs2 to memory. It computes an effective address by adding the zero-extended offset, scaled by 4, to the stack pointer, x2. It expands to sw xs2, offset(x2).

Syntax / Encoding

c.swsp xs2, imm(sp) | 110xxxxxxxxxxx10 (mask=0xe003 match=0xc002)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
16RV110xxxxxxxxxxx100xe003 / 0xc002

Operands

NameDescription
immbits [8:7,12:9], shifted << 2
xs2bits [6:2]