From 2380e4c3ce698161dc8f0be3cabfe9cbcd30652d Mon Sep 17 00:00:00 2001 From: Homer Hsing Date: Mon, 29 Jul 2013 10:25:18 +0800 Subject: [PATCH] add built-in function "isordered", "isunordered" Signed-off-by: Homer Hsing Reviewed-by: Zhigang Gong --- backend/src/ocl_stdlib.tmpl.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/backend/src/ocl_stdlib.tmpl.h b/backend/src/ocl_stdlib.tmpl.h index 1bf9fdc..d42d19b 100644 --- a/backend/src/ocl_stdlib.tmpl.h +++ b/backend/src/ocl_stdlib.tmpl.h @@ -204,6 +204,8 @@ INLINE_OVERLOADABLE int isfinite(float x) { return __builtin_isfinite(x); } INLINE_OVERLOADABLE int isinf(float x) { return __builtin_isinf(x); } INLINE_OVERLOADABLE int isnan(float x) { return __builtin_isnan(x); } INLINE_OVERLOADABLE int isnormal(float x) { return __builtin_isnormal(x); } +INLINE_OVERLOADABLE int isordered(float x, float y) { return isequal(x, x) && isequal(y, y); } +INLINE_OVERLOADABLE int isunordered(float x, float y) { return isnan(x) || isnan(y); } INLINE_OVERLOADABLE int signbit(float x) { return __builtin_signbit(x); } #define DEC1(type) INLINE_OVERLOADABLE int any(type a) { return a<0; } -- 2.7.4