[Libclc-dev] [PATCH 3/3] remquo: Flush denormals if not supported
Jan Vesely via Libclc-dev
libclc-dev at lists.llvm.org
Tue May 1 15:01:27 PDT 2018
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 <jan.vesely at rutgers.edu>
---
Note: this is the last missing math builtin for GCN. (r600 still needs
sw fma implementation)
generic/lib/math/clc_remquo.cl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/generic/lib/math/clc_remquo.cl b/generic/lib/math/clc_remquo.cl
index ff741f6..3b9159a 100644
--- a/generic/lib/math/clc_remquo.cl
+++ b/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.14.3
More information about the Libclc-dev
mailing list