in hardfloat_sys
extern entity recFNToIN<
#uint expWidth,
#uint sigWidth,
#uint intWidth
>(
control: uint<1>,
in: uint<{expWidth + sigWidth + 1}>,
roundingMode: uint<3>,
signedOut: bool,
out: inv &uint<{intWidth}>,
intExceptionFlags: inv &uint<3>
);Description taken from the Berkeley Hardfloat documentation:
Converts from a floating-point value in recoded form to an integer type.
The output named out is an unsigned integer if input signedOut is false, or is a signed integer if signedOut is true.
As explained earlier in section 7, Exception Results, the 3-bit output named intExceptionFlags reports exceptions invalid, overflow, and inexact.
Although intExceptionFlags distinguishes integer overflow separately from invalid exceptions, the IEEE Standard does not permit conversions to integer to raise a floating-point overflow exception.
Instead, if a system has no other way to indicate that a conversion to integer overflowed, the standard requires that the floating-point invalid exception be raised, not floating-point overflow.
Hence, the invalid and overflow bits from intExceptionFlags will typically be ORed together to contribute to the usual floating-point invalid exception.