Is rs2 a register operand?
No; rs2 encodes the S source format. Assembly operands are rd, rs1, rm.
Convert single-precision FP to half-precision FP; narrowing conversion rounds according to rm.
rd selects FP f0–f31, including writable f0; rs1 selects FP f0–f31; rs2 is a format selector, not a second source register.
32-bit OP-FP: funct5=01000, fmt=10, rs2=00000, opcode=1010011; no immediate.
RV32/RV64 Zfhmin (also included in Zfh); enable required extensions and FP state. Optional rm defaults to dyn, using frm; static 101/110 and dynamic frm=101–111 have reserved behavior.
FP sources narrower than FLEN require NaN-boxing checks; an invalid box is treated as a canonical source-format NaN. An H result gets upper ones when FLEN>16. Applicable exceptions accrue in fflags; setting a flag does not itself cause an FP trap.
fcvt.h.s reads a single-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=S (00) 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-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.
S-to-H is a floating-point narrowing conversion; the current example is exactly representable by the target format and leaves fflags at 0.
S-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-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.s is an FP-to-FP format conversion: rd and rs1 are FP registers, fmt encodes destination H, and rs2 encodes source S. 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.s f0, f1, rne # H result 1.25; no new fflags; f1: S value 1.25; required extensions/FP state enabled».
Understand this scenario with real code like «fcvt.h.s f0, f1, rne # H result 1.25; no new fflags; f1: S value 1.25; required extensions/FP state enabled».
No; rs2 encodes the S source format. Assembly operands are rd, rs1, rm.
For inexact conversions, rm or dynamic frm selects the rounding direction.
Both operands are FP registers; W/WU/L/LU convert between integer and FP registers.
Infinity retains its sign. A NaN result is the target canonical NaN; sNaN sets NV. Finite narrowing may raise NX, OF, or UF; the animation covers only the listed finite exact examples.