diff options
author | Ruiling Song <ruiling.song@intel.com> | 2014-12-22 12:27:19 +0800 |
---|---|---|
committer | Zhigang Gong <zhigang.gong@intel.com> | 2015-01-09 14:13:58 +0800 |
commit | 3a923b692e1345fc6ce2a8422a9371823a7eb846 (patch) | |
tree | aa2efc5a1af44c9dcfb0fe849703e96818057d31 /backend | |
parent | 6c4b16382322ba20a5d0341735c6d8e71016a30e (diff) |
libocl: flush denorm to zero in remquo()
Signed-off-by: Ruiling Song <ruiling.song@intel.com>
Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
Diffstat (limited to 'backend')
-rw-r--r-- | backend/src/libocl/tmpl/ocl_math.tmpl.cl | 2 |
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; \ |