c.fldsp
Load doubleword into floating-point register from stack
- Extension
- D, C
- XLEN
- RV32 and RV64
- Assembly (riscv-unified-db)
c.fldsp fd, imm(sp)- Length
- 16-bit (compressed)
Encoding
| 1513 | 12 | 117 | 62 | 10 | |||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 001 | uimm[5] | rd | uimm[4:3|8:6] | 10 | |||||||||||
Match 0x2002, mask 0xe003. Source: c.fldsp rd c_uimm9sphi c_uimm9splo 1..0=2 15..13=1 in riscv-opcodes/extensions/rv_c_d.
| Field | Bits | riscv-opcodes name |
|---|---|---|
| uimm[5] | 12 | c_uimm9sphi |
| rd | 11:7 | rd |
| uimm[4:3|8:6] | 6:2 | c_uimm9splo |
Description
Loads a double-precision floating-point value from memory into floating-point register fd.
It computes its effective address by adding the zero-extended offset, scaled by 8,
to the stack pointer, x2.
It expands to fld 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::D) && MISA_CSR_IMPLEMENTED && (CSR[misa].D == 1'b0)) {
reserved_instruction($encoding);
}
XReg virtual_address = X[2] + imm;
F[fd] = read_memory(64, virtual_address, $encoding);Pseudocode in riscv-unified-db’s IDL, quoted unchanged.