[libclc] r197784 - Add floating-point macro definitions v2
Tom Stellard
thomas.stellard at amd.com
Thu Dec 19 21:13:43 PST 2013
Author: tstellar
Date: Thu Dec 19 23:13:42 2013
New Revision: 197784
URL: http://llvm.org/viewvc/llvm-project?rev=197784&view=rev
Log:
Add floating-point macro definitions v2
v2:
- Fix typo.
Reviewed-by: Jan Vesely <jan.vesely at rutgers.edu>
Added:
libclc/trunk/generic/include/clc/float/
libclc/trunk/generic/include/clc/float/definitions.h
Modified:
libclc/trunk/generic/include/clc/clc.h
Modified: libclc/trunk/generic/include/clc/clc.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/clc.h?rev=197784&r1=197783&r2=197784&view=diff
==============================================================================
--- libclc/trunk/generic/include/clc/clc.h (original)
+++ libclc/trunk/generic/include/clc/clc.h Thu Dec 19 23:13:42 2013
@@ -63,6 +63,9 @@
#include <clc/math/native_sqrt.h>
#include <clc/math/rsqrt.h>
+/* 6.11.2.1 Floating-point macros */
+#include <clc/float/definitions.h>
+
/* 6.11.3 Integer Functions */
#include <clc/integer/abs.h>
#include <clc/integer/abs_diff.h>
Added: libclc/trunk/generic/include/clc/float/definitions.h
URL: http://llvm.org/viewvc/llvm-project/libclc/trunk/generic/include/clc/float/definitions.h?rev=197784&view=auto
==============================================================================
--- libclc/trunk/generic/include/clc/float/definitions.h (added)
+++ libclc/trunk/generic/include/clc/float/definitions.h Thu Dec 19 23:13:42 2013
@@ -0,0 +1,24 @@
+#define FLT_DIG 6
+#define FLT_MANT_DIG 24
+#define FLT_MAX_10_EXP +38
+#define FLT_MAX_EXP +128
+#define FLT_MIN_10_EXP -37
+#define FLT_MIN_EXP -125
+#define FLT_RADIX 2
+#define FLT_MAX 0x1.fffffep127f
+#define FLT_MIN 0x1.0p-126f
+#define FLT_EPSILON 0x1.0p-23f
+
+#ifdef cl_khr_fp64
+
+#define DBL_DIG 15
+#define DBL_MANT_DIG 53
+#define DBL_MAX_10_EXP +308
+#define DBL_MAX_EXP +1024
+#define DBL_MIN_10_EXP -307
+#define DBL_MIN_EXP -1021
+#define DBL_MAX 0x1.fffffffffffffp1023
+#define DBL_MIN 0x1.0p-1022
+#define DBL_EPSILON 0x1.0p-52
+
+#endif
More information about the cfe-commits
mailing list