Is rs2 a source register in fcvt.h.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 half-precision FP; narrowing conversion rounds according to rm.
rd selects f0–f31; rs1 selects FP f0–f31; rs2 selects format D, not a second source register.
32-bit OP-FP: funct5=01000, fmt=10, rs2=00001, opcode=1010011; no immediate.
Requires Zfhmin+D on RV32/RV64; rm/frm controls narrowing to H. 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.h.d reads a double-precision source value from FP register rs1, converts it to a half-precision FP result, and writes FP register rd. In the OP-FP encoding, fmt=H (10) 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 Zfhmin + D-extension FCVT flow: decode OP-FP fields, fmt/rs2 conversion selection, the rm rounding field, read the floating-point 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.
D-to-H is a floating-point narrowing conversion; the current example is exactly representable by the target format and leaves fflags at 0.
D-to-H 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 Zfhmin + 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.h.d is an FP-to-FP format conversion: rd and rs1 are FP registers, fmt encodes destination H, 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.h.d f0, f1, rne # 1.25 -> 1.25; initial f1=1.25 (valid D), fflags=0».
Understand this scenario with real code like «fcvt.h.d f0, f1, rne # 1.25 -> 1.25; initial f1=1.25 (valid D), fflags=0».
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.