Which register classes do rd and rs1 use in fcvt.d.w?
This is an integer-to-floating-point conversion: rs1 is an integer register and rd is a floating-point register.
Convert a signed 32-bit integer to double precision exactly.
rd selects f0–f31; rs1 selects integer x0–x31 (x0 is always zero); rs2 selects format W, not a second source register.
32-bit OP-FP: funct5=11010, fmt=01, rs2=00000, opcode=1010011; no immediate.
D supports RV32/RV64; conversion is exact and software should select rne. Optional rm defaults to dyn; reserved rounding encodings remain reserved.
Enable required extensions and FP state. Check FP-source NaN-boxing when narrower than FLEN; a narrower destination gets upper ones. Applicable exceptions accrue in fflags; setting a flag does not itself cause an FP exception trap.
fcvt.d.w converts a signed 32-bit integer source to a double-precision floating-point result. This conversion is exact, so the encoded rounding mode does not change the numeric result.
Shows the D-extension FCVT flow: decode OP-FP fields, fmt/rs2 conversion selection, the rm rounding field, read the integer source, then write the floating-point destination.
Leave rm empty for the assembly default dyn (111); this DYN example fixes frm=RNE. Use lowercase rne/rtz/rdn/rup/rmm/dyn only.
Assume required extensions and FP state are enabled, applicable source NaN-boxing is valid, and initial fflags=0. Results preview the current input; Writeback represents commit.
The word is split as an R-type OP-FP instruction; FCVT uses opcode 1010011.
A 32-bit integer is exactly representable as double precision, so example fflags remains 0.
A 32-bit integer is exactly representable as double precision, so example fflags remains 0.
This animation shows only D-extension FCVT ISA-visible encoding, source/destination register direction, rounding field, and example fflags; it does not model FPU pipelines, exception handling, NaN payloads, or microarchitecture.
fcvt.d.w reads a signed 32-bit integer from integer register rs1, converts it to double precision, and writes f[rd]; a 32-bit integer is exactly representable as double, so the numeric result does not depend on rm.
Understand this scenario with real code like «fcvt.d.w f0, x10, rne # 42 -> 42.0; initial x10=42, fflags=0».
This is an integer-to-floating-point conversion: rs1 is an integer register and rd is a floating-point register.
The encoding includes rm; a lowercase rounding operand is optional and defaults to dyn. Software should select rne; legal rm values do not change the exact result, and reserved encodings remain reserved.
rs2 is not an ordinary source register; in the FCVT encoding it selects the W signed 32-bit integer format.