C.SW
Compressed Store Word
C.SW rs2', offset(rs1')
Stores a 32-bit word to memory using a compressed encoding.
Encoding
Binary Layout
?
31:16
110
15:13
c_uimm7hi
12:10
rs1_p
9:7
c_uimm7lo
6:5
rs2_p
4:2
00
1:0
Operands
-
rs2'
Source (x8-x15) -
rs1'
Base (x8-x15) -
offset
Offset
Example
C.SW x8, 4(x9)
// 16-bit encoding of SW.
Related
More in C
Reference
View in RISC-V Unprivileged ISA Specification ↗
RISC-V ISA Manual
Description
Stores the low 32 bits of rs2′ to memory at a 6-bit unsigned offset from rs1′.
Operation
M[R[rs1'] + offset][31:0] = R[rs2'];