[Libclc-dev] [PATCH] Add missing integer min/max definitions

Aaron Watry awatry at gmail.com
Thu Jul 25 09:38:28 PDT 2013


Found in CL 1.1 spec section 6.11.3

Signed-off-by: Aaron Watry <awatry at gmail.com>
---
 generic/include/clc/clc.h                 |  3 +++
 generic/include/clc/integer/definitions.h | 15 +++++++++++++++
 2 files changed, 18 insertions(+)
 create mode 100644 generic/include/clc/integer/definitions.h

diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index 9a2f443..0b95565 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -70,6 +70,9 @@
 #include <clc/integer/sub_sat.h>
 #include <clc/integer/upsample.h>
 
+/* 6.11.3 Integer Definitions */
+#include <clc/integer/definitions.h>
+
 /* 6.11.2 and 6.11.3 Shared Integer/Math Functions */
 #include <clc/shared/clamp.h>
 #include <clc/shared/max.h>
diff --git a/generic/include/clc/integer/definitions.h b/generic/include/clc/integer/definitions.h
new file mode 100644
index 0000000..a407974
--- /dev/null
+++ b/generic/include/clc/integer/definitions.h
@@ -0,0 +1,15 @@
+#define CHAR_BIT 8
+#define INT_MAX 2147483647
+#define INT_MIN -2147483648
+#define LONG_MAX  0x7fffffffffffffffL
+#define LONG_MIN -0x8000000000000000L
+#define SCHAR_MAX 127
+#define SCHAR_MIN -128
+#define CHAR_MAX 127
+#define CHAR_MIN -128
+#define SHRT_MAX 32767
+#define SHRT_MIN -32768
+#define UCHAR_MAX 255
+#define USHRT_MAX 65535
+#define UINT_MAX 0xffffffff
+#define ULONG_MAX 0xffffffffffffffffUL
-- 
1.8.1.2





More information about the Libclc-dev mailing list