summaryrefslogtreecommitdiffstats
path: root/libclc/generic/include/clc/float/definitions.h
diff options
context:
space:
mode:
authorAaron Watry <awatry@gmail.com>2014-06-16 22:32:58 +0000
committerAaron Watry <awatry@gmail.com>2014-06-16 22:32:58 +0000
commitd9afe9def08ff23aa50363cddc36a600866809c6 (patch)
tree71e40c8bd8d93bf130bf26be4feb27d86a1eeca7 /libclc/generic/include/clc/float/definitions.h
parent8ddd66928c24f3a530cc7b670916c8fb248f9ab0 (diff)
downloadbcm5719-llvm-d9afe9def08ff23aa50363cddc36a600866809c6.tar.gz
bcm5719-llvm-d9afe9def08ff23aa50363cddc36a600866809c6.zip
Fix definition of INFINITY and add NAN/HUGE_VAL[F]
v3: change __builtin_nanf() to __builtin_nanf("") This doesn't work yet, but it was agreed to commit as-is with the logic that "broken" is better than "completely missing" and this should be fixed in clang. v2: use __builtin_inff() and also add nan/huge_val definitions Signed-off-by: Aaron Watry <awatry@gmail.com> llvm-svn: 211065
Diffstat (limited to 'libclc/generic/include/clc/float/definitions.h')
-rw-r--r--libclc/generic/include/clc/float/definitions.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libclc/generic/include/clc/float/definitions.h b/libclc/generic/include/clc/float/definitions.h
index 0fb0edfc07e..c3959643f28 100644
--- a/libclc/generic/include/clc/float/definitions.h
+++ b/libclc/generic/include/clc/float/definitions.h
@@ -1,3 +1,7 @@
+#define INFINITY __builtin_inff()
+#define NAN __builtin_nanf("")
+#define HUGE_VALF __builtin_huge_valf()
+
#define FLT_DIG 6
#define FLT_MANT_DIG 24
#define FLT_MAX_10_EXP +38
@@ -25,6 +29,8 @@
#ifdef cl_khr_fp64
+#define HUGE_VAL __builtin_huge_val()
+
#define DBL_DIG 15
#define DBL_MANT_DIG 53
#define DBL_MAX_10_EXP +308
OpenPOWER on IntegriCloud