[Beignet] [PATCH 2/2] Refine isnan builtin.

Zhigang Gong zhigang.gong at linux.intel.com
Tue Nov 26 20:38:52 PST 2013


LGTM, will push latter. Thanks.
On Mon, Nov 25, 2013 at 03:08:09PM +0800, Yang Rong wrote:
> 
> Signed-off-by: Yang Rong <rong.r.yang at intel.com>
> ---
>  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
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list