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

c.lwsp

T1 riscv alu insn
Load word from stack pointer
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

Loads a 32-bit value from memory into register xd. It computes an effective address by adding the zero-extended offset, scaled by 4, to the stack pointer, x2. It expands to lw xd, offset(x2). C.LWSP is only valid when xd ≠ x0. The code points with xd=x0 are reserved.

Syntax / Encoding

c.lwsp xd, imm(sp) | 010xxxxxxxxxxx10 (mask=0xe003 match=0x4002)

Binary Encodings (1)

WidthFormatBit PatternMask / Match
16RV010xxxxxxxxxxx100xe003 / 0x4002

Operands

NameDescription
immbits [3:2,12,6:4], shifted << 2
xdbits [11:7], not 0

Reference Notes

Loads a 32-bit value from memory into register xd.
It computes an effective address by adding the zero-extended offset, scaled by 4,
to the stack pointer, x2.
It expands to `lw` `xd, offset(x2)`.
C.LWSP is only valid when xd &ne; x0. The code points with xd=x0 are reserved.