mirror of
https://github.com/KhronosGroup/OpenCL-CTS.git
synced 2026-03-19 06:09:01 +00:00
* Allow CL_HALF_FLOAT denorm flushing for write tests (#452) * On mismatch, add relaxation when denormal half result is expected * Refactor to use common validation function * Clean up some diagnostics * Fix review comments - use cl_half - remove extraneous casts - replace literals with sizeof() * Document rollover trick for IsHalfSubnormal
This commit is contained in:
@@ -114,7 +114,8 @@ static inline cl_ulong DoubleFromUInt( cl_uint bits )
|
||||
|
||||
static inline int IsHalfSubnormal( uint16_t x )
|
||||
{
|
||||
return ((x&0x7fffU)-1U) < 0x03ffU;
|
||||
// this relies on interger overflow to exclude 0 as a subnormal
|
||||
return ( ( x & 0x7fffU ) - 1U ) < 0x03ffU;
|
||||
}
|
||||
|
||||
// prevent silent failures due to missing FLT_RADIX
|
||||
|
||||
Reference in New Issue
Block a user