Signed-off-by: Yang Rong <[email protected]>
---
 backend/src/ocl_stdlib.tmpl.h | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/backend/src/ocl_stdlib.tmpl.h b/backend/src/ocl_stdlib.tmpl.h
index e5a6da5..2a16c0d 100644
--- a/backend/src/ocl_stdlib.tmpl.h
+++ b/backend/src/ocl_stdlib.tmpl.h
@@ -248,9 +248,7 @@ INLINE_OVERLOADABLE int isinf(float x) {
   return (u.u & 0x7FFFFFFF) == 0x7F800000;
 }
 INLINE_OVERLOADABLE int isnan(float x) {
-  union { uint u; float f; } u;
-  u.f = x;
-  return (u.u & 0x7FFFFFFF) > 0x7F800000;
+  return x != x;
 }
 INLINE_OVERLOADABLE int isnormal(float x) {
   union { uint u; float f; } u;
-- 
1.8.1.2

_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to