CVFPU incorrectly suppresses overflow flag on `I2F` conversions
Created by: michael-platzer
According to IEEE 754-2008, converting an integer to a floating-point value should trigger an overflow exception in case the rounded value exceeds the range of the floating-point type.
However, CVFPU suppresses the overflow flag when the source operand is an integer (i.e., on I2F
conversions), and sets the invalid flag instead:
The comment on line 721 is incorrect: an overflow should not trigger an invalid exception on I2F
conversions.
I believe this has been confused with the opposite case, converting a floating-point value to an integer, which indeed is not supposed to produce an overflow exception:
For single-precision and double-precision types an overflow cannot happen, because the exponent range is always large enough such that any 32-bit or 64-bit integer value does not exceed it. However, for half-precision values an overflow can occur on I2F
conversions.
@lucabertaccini
@pascalgouedo
@stmach
Please let me know whether my assessment is correct. I will then move forward with a PR to fix the behavior.