c.flwsp
Load word into floating-point register from stack
Encoding
| 1513 | 12 | 117 | 62 | 10 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 011 | uimm[5] | rd | uimm[4:2|7:6] | 10 | |||||||||||
Match 0x6002, mask 0xe003. Source: c.flwsp rd c_uimm8sphi c_uimm8splo 1..0=2 15..13=3 in riscv-opcodes/extensions/rv32_c_f.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| uimm[5] | 12 | c_uimm8sphi |
| rd | 11:7 | rd |
| uimm[4:2|7:6] | 6:2 | c_uimm8splo |
Description
Loads a single-precision floating-point value from memory into floating-point register fd.
It computes its effective address by adding the zero-extended offset, scaled by 4,
to the stack pointer, x2.
It expands to flw fd, offset(x2).
Description from riscv-unified-db, reformatted.
Operation
if (implemented?(ExtensionName::C) && MISA_CSR_IMPLEMENTED && (CSR[misa].C == 1'b0)) {
reserved_instruction($encoding);
}
if (implemented?(ExtensionName::F) && MISA_CSR_IMPLEMENTED && (CSR[misa].F == 1'b0)) {
reserved_instruction($encoding);
}
XReg virtual_address = X[2] + imm;
F[fd] = read_memory(32, virtual_address, $encoding);Pseudocode in riscv-unified-db’s IDL, quoted unchanged.