Is rs2 a source register in fcvt.h.s?
No. The assembly syntax has rd, rs1, rm only; the encoded rs2 field selects the source S FP format.
Convert single-precision FP to half-precision FP; narrowing conversion rounds according to rm.
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.
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 # f0 = (half-precision)(f1 as single-precision)».
Understand this scenario with real code like «fcvt.h.s f0, f1, rne # f0 = (half-precision)(f1 as single-precision)».
No. The assembly syntax has rd, rs1, rm only; the encoded rs2 field selects the source S 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.