summaryrefslogtreecommitdiff
path: root/generic/include
diff options
context:
space:
mode:
Diffstat (limited to 'generic/include')
-rw-r--r--generic/include/clc/clc.h4
-rw-r--r--generic/include/clc/integer/integer-gentype.inc39
-rw-r--r--generic/include/clc/integer/mad24.h3
-rw-r--r--generic/include/clc/integer/mad24.inc1
-rw-r--r--generic/include/clc/integer/mul24.h3
-rw-r--r--generic/include/clc/integer/mul24.inc1
-rw-r--r--generic/include/clc/integer/upsample.h25
-rw-r--r--generic/include/clc/relational/bitselect.h1
8 files changed, 77 insertions, 0 deletions
diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index 10d30e0..9a2f443 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -64,8 +64,11 @@
#include <clc/integer/abs_diff.h>
#include <clc/integer/add_sat.h>
#include <clc/integer/clz.h>
+#include <clc/integer/mad24.h>
+#include <clc/integer/mul24.h>
#include <clc/integer/rotate.h>
#include <clc/integer/sub_sat.h>
+#include <clc/integer/upsample.h>
/* 6.11.2 and 6.11.3 Shared Integer/Math Functions */
#include <clc/shared/clamp.h>
@@ -82,6 +85,7 @@
/* 6.11.6 Relational Functions */
#include <clc/relational/any.h>
+#include <clc/relational/bitselect.h>
#include <clc/relational/select.h>
/* 6.11.8 Synchronization Functions */
diff --git a/generic/include/clc/integer/integer-gentype.inc b/generic/include/clc/integer/integer-gentype.inc
new file mode 100644
index 0000000..6470eb3
--- /dev/null
+++ b/generic/include/clc/integer/integer-gentype.inc
@@ -0,0 +1,39 @@
+#define __CLC_GENTYPE int
+#include __CLC_BODY
+#undef __CLC_GENTYPE
+
+#define __CLC_GENTYPE int2
+#include __CLC_BODY
+#undef __CLC_GENTYPE
+
+#define __CLC_GENTYPE int4
+#include __CLC_BODY
+#undef __CLC_GENTYPE
+
+#define __CLC_GENTYPE int8
+#include __CLC_BODY
+#undef __CLC_GENTYPE
+
+#define __CLC_GENTYPE int16
+#include __CLC_BODY
+#undef __CLC_GENTYPE
+
+#define __CLC_GENTYPE uint
+#include __CLC_BODY
+#undef __CLC_GENTYPE
+
+#define __CLC_GENTYPE uint2
+#include __CLC_BODY
+#undef __CLC_GENTYPE
+
+#define __CLC_GENTYPE uint4
+#include __CLC_BODY
+#undef __CLC_GENTYPE
+
+#define __CLC_GENTYPE uint8
+#include __CLC_BODY
+#undef __CLC_GENTYPE
+
+#define __CLC_GENTYPE uint16
+#include __CLC_BODY
+#undef __CLC_GENTYPE
diff --git a/generic/include/clc/integer/mad24.h b/generic/include/clc/integer/mad24.h
new file mode 100644
index 0000000..0c120fa
--- /dev/null
+++ b/generic/include/clc/integer/mad24.h
@@ -0,0 +1,3 @@
+#define __CLC_BODY <clc/integer/mad24.inc>
+#include <clc/integer/integer-gentype.inc>
+#undef __CLC_BODY
diff --git a/generic/include/clc/integer/mad24.inc b/generic/include/clc/integer/mad24.inc
new file mode 100644
index 0000000..81fe0c2
--- /dev/null
+++ b/generic/include/clc/integer/mad24.inc
@@ -0,0 +1 @@
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mad24(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z);
diff --git a/generic/include/clc/integer/mul24.h b/generic/include/clc/integer/mul24.h
new file mode 100644
index 0000000..4f97098
--- /dev/null
+++ b/generic/include/clc/integer/mul24.h
@@ -0,0 +1,3 @@
+#define __CLC_BODY <clc/integer/mul24.inc>
+#include <clc/integer/integer-gentype.inc>
+#undef __CLC_BODY
diff --git a/generic/include/clc/integer/mul24.inc b/generic/include/clc/integer/mul24.inc
new file mode 100644
index 0000000..8cbf7c1
--- /dev/null
+++ b/generic/include/clc/integer/mul24.inc
@@ -0,0 +1 @@
+_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mul24(__CLC_GENTYPE x, __CLC_GENTYPE y);
diff --git a/generic/include/clc/integer/upsample.h b/generic/include/clc/integer/upsample.h
new file mode 100644
index 0000000..127debf
--- /dev/null
+++ b/generic/include/clc/integer/upsample.h
@@ -0,0 +1,25 @@
+#define __CLC_UPSAMPLE_DECL(BGENTYPE, GENTYPE, UGENTYPE) \
+ _CLC_OVERLOAD _CLC_DECL BGENTYPE upsample(GENTYPE hi, UGENTYPE lo);
+
+#define __CLC_UPSAMPLE_VEC(BGENTYPE, GENTYPE, UGENTYPE) \
+ __CLC_UPSAMPLE_DECL(BGENTYPE, GENTYPE, UGENTYPE); \
+ __CLC_UPSAMPLE_DECL(BGENTYPE##2, GENTYPE##2, UGENTYPE##2); \
+ __CLC_UPSAMPLE_DECL(BGENTYPE##3, GENTYPE##3, UGENTYPE##3); \
+ __CLC_UPSAMPLE_DECL(BGENTYPE##4, GENTYPE##4, UGENTYPE##4); \
+ __CLC_UPSAMPLE_DECL(BGENTYPE##8, GENTYPE##8, UGENTYPE##8); \
+ __CLC_UPSAMPLE_DECL(BGENTYPE##16, GENTYPE##16, UGENTYPE##16); \
+
+#define __CLC_UPSAMPLE_TYPES() \
+ __CLC_UPSAMPLE_VEC(short, char, uchar) \
+ __CLC_UPSAMPLE_VEC(ushort, uchar, uchar) \
+ __CLC_UPSAMPLE_VEC(int, short, ushort) \
+ __CLC_UPSAMPLE_VEC(uint, ushort, ushort) \
+ __CLC_UPSAMPLE_VEC(long, int, uint) \
+ __CLC_UPSAMPLE_VEC(ulong, uint, uint) \
+
+__CLC_UPSAMPLE_TYPES()
+
+#undef __CLC_UPSAMPLE_TYPES
+#undef __CLC_UPSAMPLE_DECL
+#undef __CLC_UPSAMPLE_VEC
+
diff --git a/generic/include/clc/relational/bitselect.h b/generic/include/clc/relational/bitselect.h
new file mode 100644
index 0000000..e91cbfd
--- /dev/null
+++ b/generic/include/clc/relational/bitselect.h
@@ -0,0 +1 @@
+#define bitselect(x, y, z) ((x) ^ ((z) & ((y) ^ (x))))