Does every negative input set NV?
No. Range is checked after rounding: -0.5 under RNE or RTZ becomes 0 with NX, while RDN produces an out-of-range −1 and sets NV.
Round half-precision FP to unsigned 32-bit integer; RV64 still sign-extends.
32-bit OP-FP fields: opcode=1010011, funct5=11000, fmt=10; rs2=00001 is a fixed selector, not a second source.
rd is x0–x31 and rs1 is f0–f31; rd=x0 discards only the integer write, while fflags still accrues.
RV32/RV64 Zfh (requires F; Zfhmin excludes this instruction); optional rm defaults to dyn using frm. Static 101/110 and dynamic frm=101–111 have reserved behavior. Enable required extensions and FP state.
Round using rm before checking 0..2^32−1: negative out-of-range/−infinity writes 0, positive out-of-range/+infinity/NaN writes 2^32−1 with NV. A changed result sets NX only without NV. RV64 sign-extends bit 31.
Sources narrower than FLEN require valid NaN-boxing, otherwise read canonical NaN. Exception flags accrue in fflags; flag setting alone causes no base FP exception trap.
fcvt.wu.h rounds the half-precision value in FP register rs1 to an unsigned 32-bit integer in integer rd. Validity is checked after rounding against 0 through 2^32−1. RV64 sign-extends bit 31 to XLEN, including WU results.
Shows the Zfh-extension FCVT flow: decode OP-FP fields, fmt/rs2 conversion selection, the rm rounding field, read the floating-point source, then write the integer 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.
The current example rounds to a 32-bit integer according to rm and shows NX because the source has a fractional part.
The current example rounds to a 32-bit integer according to rm and shows NX because the source has a fractional part.
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.wu.h rounds the half-precision value in FP register rs1 to an unsigned 32-bit integer in integer rd. Validity is checked after rounding against 0 through 2^32−1. RV64 sign-extends bit 31 to XLEN, including WU results.
Understand this scenario with real code like «# f0 = 3.5; initial fflags = 0 fcvt.wu.h x10, f0, rtz # x10 = 3; NX = 1».
No. Range is checked after rounding: -0.5 under RNE or RTZ becomes 0 with NX, while RDN produces an out-of-range −1 and sets NV.
No. The 32-bit result is sign-extended to XLEN. For example, unsigned target 2^32−1 writes 0xFFFFFFFFFFFFFFFF.