[Beignet] [PATCH 1/3] libocl: flush denorm into zero in ldexp()
Zhigang Gong
zhigang.gong at linux.intel.com
Sun Dec 21 20:18:53 PST 2014
The whole patchset LGTM, will push latter, thanks.
On Mon, Dec 22, 2014 at 12:27:17PM +0800, Ruiling Song wrote:
> inf and denorm logic in internal_ldexp() is useless, as inf and denorm
> is already handled in __gen_ocl_scalbnf() and wrapper function.
>
> It is better to flush denorm to zero in wrapper function,
> so we don't have to change the internal implementation.
>
> Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> ---
> backend/src/libocl/tmpl/ocl_math.tmpl.cl | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/backend/src/libocl/tmpl/ocl_math.tmpl.cl b/backend/src/libocl/tmpl/ocl_math.tmpl.cl
> index 248ddd0..5d73c16 100644
> --- a/backend/src/libocl/tmpl/ocl_math.tmpl.cl
> +++ b/backend/src/libocl/tmpl/ocl_math.tmpl.cl
> @@ -2672,7 +2672,6 @@ OVERLOADABLE float __gen_ocl_internal_remainder(float x, float p){
> }
>
> OVERLOADABLE float __gen_ocl_internal_ldexp(float x, int n) {
> - if(!__ocl_finitef(x)||x==(float)0.0) return x;
> x = __gen_ocl_scalbnf(x,n);
> return x;
> }
> @@ -2878,6 +2877,7 @@ OVERLOADABLE float ldexp(float x, int n) {
> if (__ocl_math_fastpath_flag)
> return __gen_ocl_internal_fastpath_ldexp(x, n);
>
> + if (x == (float)0.0f) x = 0.0f;
> return __gen_ocl_internal_ldexp(x, n);
> }
>
> --
> 1.7.10.4
>
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
More information about the Beignet
mailing list