FCVT.D.S

RISC-V FCVT.D.S Instruction Details

Instruction ManualR-type

Convert single to double: f[rd] = (double)f[rs1]. Never rounds.

Instruction Syntax

fcvt.d.s rd, rs1
Operand Breakdown
Destination rd: register receiving the operation result.
Source rs1: register holding the first operand.
Source rs2: register holding the second operand.
DFloating-Point Convert

Instruction Behavior

fcvt.d.s converts a single-precision source operand to a wider double-precision result. This floating-point widening conversion is exact and does not round.

Quick Understanding & Search Notes

fcvt.d.s converts a single-precision source operand to a wider double-precision result. This floating-point widening conversion is exact and does not round.

The rs2/fmt encoding selects source and destination formats; the mnemonic suffixes carry the main semantic distinction.
This is a floating-point widening conversion, not a narrowing conversion; rm does not affect the numeric result.
The floating-point source operand in a wider FLEN register must satisfy NaN-boxing rules.
The floating-point result is NaN-boxed in the FLEN register according to the destination format.

Common Usage Scenarios

Floating Point Basic

Understand this scenario with real code like «fcvt.d.s f0, f1 # f0 = (double)(float)f1».

Pre-Use Checklist

Syntax Check
  • Confirm the current instruction format is R-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

This is a floating-point widening conversion, not a narrowing conversion; rm does not affect the numeric result.
The floating-point source operand in a wider FLEN register must satisfy NaN-boxing rules.
The floating-point result is NaN-boxed in the FLEN register according to the destination format.

FAQ

When does rm matter for fcvt.d.s?

It does not matter for the numeric result. This form is an exact widening conversion and does not require rounding.

How does fcvt.d.s differ from related FCVT instructions?

It differs by source/destination format, integer signedness, RV64 restrictions, and whether rounding or invalid conversion can occur.