aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorGil Pitney <gil.pitney@linaro.org>2014-12-08 14:23:47 -0800
committerGil Pitney <gil.pitney@linaro.org>2014-12-08 14:23:47 -0800
commit76bd0a080cd23ea52bd88d0520b2f450ad33a6c5 (patch)
treeda1acc6a3bdaaacb2b08ece028e5eb45e387b0b2 /include
parent5d2eb9a1fc2ea97f717f1f819a088364412c9ddc (diff)
builtins: Fixed nextafter builtin; updated INFINITY definition.
Redefined nextafter to use __builtin_nextafterf(), and INFINITY to use __builtin_inff(). This enables the Khronos basic test kernel_limit_constants to pass. Signed-off-by: Gil Pitney <gil.pitney@linaro.org>
Diffstat (limited to 'include')
-rw-r--r--include/clc.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/include/clc.h b/include/clc.h
index c6e6b5d..4828f7d 100644
--- a/include/clc.h
+++ b/include/clc.h
@@ -855,7 +855,7 @@ SELECT_EXPAND_TYPES
#define MAXFLOAT FLT_MAX
#define HUGE_VALF __builtin_huge_valf()
-#define INFINITY (1.0f / 0.0f)
+#define INFINITY __builtin_inff()
#define NAN (0.0f / 0.0f)
#define HUGE_VAL __builtin_huge_val()
@@ -998,7 +998,11 @@ _CLC_OVERLOAD _CLC_INLINE double nan(ulong nancode)
UNARY_VEC_DECL(uint, float, nan)
UNARY_VEC_DECL(ulong, double, nan)
-BINARY(nextafter)
+BINARY_INLINE (float, float, nextafter, __builtin_nextafterf)
+BINARY_INLINE (double, double, nextafter, __builtin_nextafter)
+BINARY_VEC_DECL(float, float, nextafter)
+BINARY_VEC_DECL(double, double, nextafter)
+
BINARY(pow)
_CLC_PROTECTED double builtin_pow(double x, double y);