fsw
Floating-Point Store Single-Precision
- Extension
- F
- XLEN
- RV32 and RV64
- Assembly (riscv-unified-db)
fsw fs2, imm(xs1)- Length
- 32-bit
Encoding
| 3125 | 2420 | 1915 | 1412 | 117 | 62 | 10 | |||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| imm[11:5] | rs2 | rs1 | 010 | imm[4:0] | 01001 | 11 | |||||||||||||||||||||||||
Match 0x00002027, mask 0x0000707f. Source: fsw imm12hi rs1 rs2 imm12lo 14..12=2 6..2=0x09 1..0=3 in riscv-opcodes/extensions/rv_f.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| imm[11:5] | 31:25 | imm12hi |
| rs2 | 24:20 | rs2 |
| rs1 | 19:15 | rs1 |
| imm[4:0] | 11:7 | imm12lo |
Description
The fsw instruction stores a single-precision floating-point value in fs2 to memory at address xs1 + imm.
It does not modify the bits being transferred; in particular, the payloads of non-canonical NaNs are preserved.
Description from riscv-unified-db, reformatted.
Operation
check_f_ok($encoding); XReg virtual_address = X[xs1] + $signed(imm); write_memory(32, virtual_address, F[fs2][31:0], $encoding);
Pseudocode in riscv-unified-db’s IDL, quoted unchanged.