Webcentive RISC-V Reference

c.fld

Load double-precision

Extension
D, C
XLEN
RV32 and RV64
Assembly (riscv-unified-db)
c.fld fd, imm(xs1)
Length
16-bit (compressed)

Encoding

1513121097654210
001uimm[5:3]rs1′uimm[7:6]rd′00

Match 0x2000, mask 0xe003. Source: c.fld rd_p rs1_p c_uimm8lo c_uimm8hi 1..0=0 15..13=1 in riscv-opcodes/extensions/rv_c_d.

FieldBitsriscv-opcodes name
uimm[5:3]12:10c_uimm8hi
rs1′9:7rs1_p
uimm[7:6]6:5c_uimm8lo
rd′4:2rd_p

Description

Loads a double precision floating-point value from memory into register fd. It computes an effective address by adding the zero-extended offset, scaled by 8, to the base address in register xs1. It expands to fld fd, 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;

F[creg2reg(fd)] = sext(read_memory(64, virtual_address, $encoding), 64);

Pseudocode in riscv-unified-db’s IDL, quoted unchanged.

Specification and related pages