C.FLDSP

RISC-V C.FLDSP Instruction Details

Instruction ManualC-type

Load double FP from sp+offset. CI format, RV32DC/RV64DC.

Instruction Syntax

c.fldsp fd, offset(sp)
Operand Breakdown
Compressed instructions are 16 bits; registers are often limited to x8–x15.
Immediate fields are narrower. Refer to the full encoding for this compressed instruction.
CDCompressed Instruction

Instruction Behavior

c.fldsp loads a 64-bit double-precision value from sp plus a zero-extended offset scaled by 8 into floating-point fd.

Quick Understanding & Search Notes

c.fldsp loads a 64-bit double-precision value from sp plus a zero-extended offset scaled by 8 into floating-point fd.

This is a real 16-bit C-extension memory encoding with semantics corresponding to the FLD/FLW/FSD/FSW floating-point load/store family.
The base is fixed to x2/sp; the destination is a floating-point register; D and C are required.
The offset is zero-extended and scaled by access width in the encoding; it is not an arbitrary byte immediate.

Common Usage Scenarios

Register Operations

Understand this scenario with real code like «c.fldsp f0, 16(sp) # f0 = *(sp+16)».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is C-type.
  • Confirm the operand order matches the example.
Semantic Check
  • Ensure the destination register usage is compatible with the calling convention.
  • Confirm this is not the lower-level form of a pseudo-instruction expansion.

Pitfalls / Common Confusions

The base is fixed to x2/sp; the destination is a floating-point register; D and C are required.
The offset is zero-extended and scaled by access width in the encoding; it is not an arbitrary byte immediate.

FAQ

What is the offset unit for c.fldsp?

The encoded immediate is scaled by access width: 8 bytes for double-precision and 4 bytes for single-precision.

Does c.fldsp require a floating-point extension?

Yes. Double-precision forms require D, single-precision forms require F, and all require C.