diff options
author | Ruiling Song <ruiling.song@intel.com> | 2014-12-22 12:27:17 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2014-12-22 12:19:39 +0800 |
commit | 4db0c1241b462f82ac2cd8ece8102129882d9f20 (patch) | |
tree | abfcd672ea863a0ef8cbd3fcf24b63e80449c2d5 | |
parent | 576f02591edaa51e5736d9584b614c58123df5e7 (diff) |
libocl: flush denorm into zero in ldexp()
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@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
-rw-r--r-- | backend/src/libocl/tmpl/ocl_math.tmpl.cl | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/src/libocl/tmpl/ocl_math.tmpl.cl b/backend/src/libocl/tmpl/ocl_math.tmpl.cl index 248ddd05..5d73c163 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); } |