From 21e77037c0f00b943421884ee18b920b405a517c Mon Sep 17 00:00:00 2001 From: Jan Vesely Date: Thu, 3 May 2018 05:44:28 +0000 Subject: [PATCH] remquo: Flush denormals if not supported It's OK to either flush to 0 or return denormal result if the device does not support denormals. See sec 7.2 and 7.5.3 of OCL specs. Fixes CTS on carrizo and turks. Signed-off-by: Jan Vesely Reviewer: Aaron Watry llvm-svn: 331435 --- libclc/generic/lib/math/clc_remquo.cl | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libclc/generic/lib/math/clc_remquo.cl b/libclc/generic/lib/math/clc_remquo.cl index ff741f6..3b9159a 100644 --- a/libclc/generic/lib/math/clc_remquo.cl +++ b/libclc/generic/lib/math/clc_remquo.cl @@ -29,6 +29,8 @@ _CLC_DEF _CLC_OVERLOAD float __clc_remquo(float x, float y, __private int *quo) { + x = __clc_flush_denormal_if_not_supported(x); + y = __clc_flush_denormal_if_not_supported(y); int ux = as_int(x); int ax = ux & EXSIGNBIT_SP32; float xa = as_float(ax); -- 2.7.4