fcfidu
Floating Convert from Unsigned Integer Doubleword
Converts 64-bit Unsigned Int to Double.
Details
The fcfidu instruction converts a 64-bit unsigned integer from register FRB into a double-precision floating-point value in register FRT. If the source is NaN, it sets VXCVI and VXSNAN flags accordingly. If the rounded value exceeds 2^32 - 1 or is less than 0, it returns 0xFFFF_FFFF or 0x0000_0000 respectively, setting VXCVI. Otherwise, it converts the rounded value to a 32-bit unsigned integer and sets XX if inexact.
Pseudocode Operation
Let src be the double-precision floating-point value in FRB.
If src is a NaN, then the result is 0x0000_0000, VXCVI is set to 1, and, if src is an SNaN, VXSNAN is set to 1.
Otherwise, src is rounded to a floating-point integer using the rounding mode Round toward Zero.
If the rounded value is greater than 2^32 - 1, then the result is 0xFFFF_FFFF and VXCVI is set to 1.
Otherwise, if the rounded value is less than 0.0, then the result is 0x0000_0000 and VXCVI is set to 1.
Otherwise, the result is the rounded value converted to 32-bit unsigned-integer format, and XX is set to 1 if the result is inexact.
Programming Note
The fcfidu instruction converts a 64-bit unsigned integer to a double-precision floating-point value. Be cautious of NaN inputs, which will result in zero with VXCVI set. Ensure the source register contains valid data; otherwise, unexpected results may occur. This instruction operates at user privilege level.
Example
Encoding
Operands
-
FRT
Target -
FRB
Source