Is rs2 a source register in fcvt.s.d?
No. The assembly syntax has rd, rs1, rm only; the encoded rs2 field selects the source D FP format.
Convert double-precision FP to single-precision FP; narrowing conversion rounds according to rm.
fcvt.s.d reads a double-precision source value from FP register rs1, converts it to a single-precision FP result, and writes FP register rd. In the OP-FP encoding, fmt=S (00) denotes the destination format and rs2=D (01) denotes the source format; this narrowing conversion rounds according to rm/frm when the destination format cannot represent the source exactly and may set FP exception flags.
Shows the D-extension FCVT flow: decode OP-FP fields, fmt/rs2 conversion selection, rm rounding, read the floating-point source, then write the floating-point destination.
The word is split as an R-type OP-FP instruction; FCVT conversion instructions use opcode 1010011.
D-to-S is a floating-point narrowing conversion; the current example is exactly representable by the target format and leaves fflags at 0.
D-to-S is a floating-point narrowing conversion; the current example is exactly representable by the target format and leaves fflags at 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.s.d is an FP-to-FP format conversion: rd and rs1 are FP registers, fmt encodes destination S, and rs2 encodes source D. The narrowing conversion rounds according to rm/frm and may set FP exception flags such as NX, OF, or UF.
Understand this scenario with real code like «fcvt.s.d f0, f1, rne # f0 = (single-precision)(f1 as double-precision)».
Understand this scenario with real code like «fcvt.s.d f0, f1, rne # f0 = (single-precision)(f1 as double-precision)».
No. The assembly syntax has rd, rs1, rm only; the encoded rs2 field selects the source D FP format.
When the destination format cannot exactly represent the source value, rm or dynamic frm selects the rounding direction.
In this form, both rd and rs1 are FP registers; W/WU/L/LU forms convert between integer and FP registers.