C.SWSP

Compressed Store Word to Stack Pointer

C.SWSP rs2, offset(x2)

Stores a word to the stack pointer (x2).

Details

Stores the low 32 bits of rs2 to a stack-pointer-relative address.

Pseudocode Operation

M[R[2] + offset][31:0] = R[rs2];

Example

C.SWSP x10, 8(x2)

Encoding

Binary Layout
?
31:16
110
15:13
c_uimm8sp_s
12:7
c_rs2
6:2
10
1:0
 
Format CSS
Opcode 0x0000C002
Extension C

Operands

  • rs2
    Source
  • offset
    Offset