mirror of
https://github.com/libretro/RetroArch.git
synced 2026-11-21 12:29:43 -10:00
retro_half_to_float and retro_float_to_half convert IEEE 754 binary16 to and from binary32 with integer arithmetic only, so flush-to-zero and denormals-are-zero modes change nothing. Narrowing rounds to nearest, ties to even, as F16C and GPUs do; subnormal halves, signed zeros, infinities and NaNs are kept (a signalling NaN comes back quiet). The Direct3D and Vulkan HDR screenshot paths each had a private copy of the widening; both use the header now. float16_test checks every half against its value and its round trip, the floats in and near the half range of both signs against F16C's VCVTPS2PH (a stride elsewhere), a stride against the nearest half by search, and the same again with FTZ and DAZ set.