summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRuiling Song <ruiling.song@intel.com>2014-12-22 12:27:19 +0800
committerZhigang Gong <zhigang.gong@intel.com>2014-12-22 12:34:49 +0800
commit3fafa02325bb99d42ac5e8988feb8505cf0fee64 (patch)
treea8bd6a081729ffb3c8419d2bd1661d87de6f93b5
parent4c82042d261e646092810d27dde998a5ccace998 (diff)
libocl: flush denorm to zero in remquo()test_math
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.cl2
1 files changed, 2 insertions, 0 deletions
diff --git a/backend/src/libocl/tmpl/ocl_math.tmpl.cl b/backend/src/libocl/tmpl/ocl_math.tmpl.cl
index 220f3515..c4402768 100644
--- a/backend/src/libocl/tmpl/ocl_math.tmpl.cl
+++ b/backend/src/libocl/tmpl/ocl_math.tmpl.cl
@@ -3260,6 +3260,8 @@ OVERLOADABLE float fract(float x, private float *p) { BODY; }
int n,hx,hy,hz,ix,iy,sx,i,sy; \
uint q,sxy; \
Zero[0] = 0.0;Zero[1] = -0.0; \
+ if (x == 0.0f) { x = 0.0f; }; \
+ if (y == 0.0f) { y = 0.0f; }\
GEN_OCL_GET_FLOAT_WORD(hx,x);GEN_OCL_GET_FLOAT_WORD(hy,y); \
sxy = (hx ^ hy) & 0x80000000;sx = hx&0x80000000;sy = hy&0x80000000; \
hx ^=sx; hy &= 0x7fffffff; \