When does rm matter for fcvt.h.l?
When the integer value cannot be exactly represented in the destination floating-point format, rm or dynamic frm selects the rounding direction.
Convert a signed 64-bit integer to half-precision floating point [RV64]; rm or dynamic frm selects rounding when needed.
fcvt.h.l converts a signed 64-bit integer source to a half-precision floating-point result. If the value is not exactly representable, the result is rounded according to rm and written to f[rd].
Shows the Zfh-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.
The word is split as an R-type OP-FP instruction; FCVT uses opcode 1010011.
The current 64-bit integer example is not exactly representable as H format, so the rounded example shows NX.
The current 64-bit integer example is not exactly representable as H format, so the rounded example shows NX.
This animation shows only Zfh-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.l converts a signed 64-bit integer source to a half-precision floating-point result. If the value is not exactly representable, the result is rounded according to rm and written to f[rd].
Understand this scenario with real code like «fcvt.h.l f0, x10, rne # f0 = (half)(long)x10 (RV64)».
Understand this scenario with real code like «fcvt.h.l f0, x10, rne # f0 = (half)(long)x10 (RV64)».
When the integer value cannot be exactly represented in the destination floating-point format, rm or dynamic frm selects the rounding direction.
It differs by source/destination format, integer signedness, RV64 restriction, and whether rm/frm rounding is needed; this form sets NX when rounding changes the result and OF on half-precision range overflow.