C.LWSP
Compressed Load Word from Stack Pointer
C.LWSP rd, offset(x2)
Loads a word from the stack pointer (x2).
Encoding
Binary Layout
?
31:16
010
15:13
c_uimm8sphi
12
rd_n0
11:7
c_uimm8splo
6:2
10
1:0
Operands
-
rd
Destination register (integer) -
offset
Offset
Example
C.LWSP x10, 4(x2)
// Load from stack.
Related
More in C
Reference
View in RISC-V Unprivileged ISA Specification ↗
RISC-V ISA Manual
Description
Loads a 32-bit word from a stack-pointer-relative address into rd.
Operation
R[rd] = M[R[2] + offset][31:0];