c.fsw
Store single-precision
Encoding
| 1513 | 1210 | 97 | 65 | 42 | 10 | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 111 | uimm[5:3] | rs1′ | uimm[2|6] | rs2′ | 00 | ||||||||||
Match 0xe000, mask 0xe003. Source: c.fsw rs1_p rs2_p c_uimm7lo c_uimm7hi 1..0=0 15..13=7 in riscv-opcodes/extensions/rv32_c_f.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| uimm[5:3] | 12:10 | c_uimm7hi |
| rs1′ | 9:7 | rs1_p |
| uimm[2|6] | 6:5 | c_uimm7lo |
| rs2′ | 4:2 | rs2_p |
Description
Stores a single precision floating-point value in register fs2 to memory.
It computes an effective address by adding the zero-extended offset, scaled by 4,
to the base address in register xs1.
It expands to fsw fs2, offset(xs1).
Description from riscv-unified-db, reformatted.
Operation
if (implemented?(ExtensionName::C) && MISA_CSR_IMPLEMENTED && (CSR[misa].C == 1'b0)) {
reserved_instruction($encoding);
}
XReg virtual_address = X[creg2reg(xs1)] + imm;
write_memory(32, virtual_address, F[creg2reg(fs2)][31:0], $encoding);Pseudocode in riscv-unified-db’s IDL, quoted unchanged.