[Libclc-dev] [PATCH 3/3] remquo: Flush denormals if not supported

Aaron Watry via Libclc-dev libclc-dev at lists.llvm.org
Wed May 2 20:12:56 PDT 2018


On Tue, 2018-05-01 at 18:01 -0400, Jan Vesely via Libclc-dev wrote:
> 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>

This series look ok to me (I'll trust the CTS for the correctness of
the ported implementation).  I've run it through CTS on both my BARTS
(6850, no doubles) and my RX 580 and it passes all remquo tests.

--Aaron

> ---
> 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);


More information about the Libclc-dev mailing list