From: Yang Rong Date: Mon, 25 Nov 2013 07:08:09 +0000 (+0800) Subject: Refine isnan builtin. X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0678018e714901076fd3da31aa983cc6dfed3d32;p=contrib%2Fbeignet.git Refine isnan builtin. Signed-off-by: Yang Rong Reviewed-by: Zhigang Gong --- diff --git a/backend/src/ocl_stdlib.tmpl.h b/backend/src/ocl_stdlib.tmpl.h index 555c63c..851a9aa 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;