[Beignet] [PATCH 3/3] libocl: flush denorm to zero in remquo()
Ruiling Song
ruiling.song at intel.com
Sun Dec 21 20:27:19 PST 2014
Signed-off-by: Ruiling Song <ruiling.song at intel.com>
---
backend/src/libocl/tmpl/ocl_math.tmpl.cl | 2 ++
1 file changed, 2 insertions(+)
diff --git a/backend/src/libocl/tmpl/ocl_math.tmpl.cl b/backend/src/libocl/tmpl/ocl_math.tmpl.cl
index 3ec9af6..d857890 100644
--- a/backend/src/libocl/tmpl/ocl_math.tmpl.cl
+++ b/backend/src/libocl/tmpl/ocl_math.tmpl.cl
@@ -3262,6 +3262,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; \
--
1.7.10.4
More information about the Beignet
mailing list