Skip to content

nir/lower_int64: Fix float16 to int64 conversions.

Follow up to !19128 (merged). Currently float16 to int64 conversions don't work correctly, because the "div" variable has an infinite value, since 2^32 isn't representable as a 16-bit float, which causes the result of of frem(x, div) to be NaN for all inputs, leading to an incorrect result. Since no values of magnitude greater than 2^32 are representable as a float16 we don't actually need to do the fdiv/frem operations, the conversion is equivalent to f2u32 with the result padded to 64 bits. This fixes some float16/int64 conversion tests from the Vulkan CTS on MTL hardware.

Merge request reports