summaryrefslogtreecommitdiff
path: root/generic/include/clc
diff options
context:
space:
mode:
authorTom Stellard <thomas.stellard@amd.com>2013-06-26 18:22:11 +0000
committerTom Stellard <thomas.stellard@amd.com>2013-06-26 18:22:11 +0000
commit1a71238de08d32b405073ae2d818b479b4f73a77 (patch)
tree2dfcab235ffae36e1dd0249ee536871572de0f3d /generic/include/clc
parent6b73fd445be70e84dc214d88f7802ef800a76b4f (diff)
libclc: Initial vstore implementation
Assumes that the target supports byte-addressable stores. Completely unoptimized. Patch by: Aaron Watry git-svn-id: https://llvm.org/svn/llvm-project/libclc/trunk@185007 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'generic/include/clc')
-rw-r--r--generic/include/clc/clc.h1
-rw-r--r--generic/include/clc/shared/vstore.h36
2 files changed, 37 insertions, 0 deletions
diff --git a/generic/include/clc/clc.h b/generic/include/clc/clc.h
index 7937003..10d30e0 100644
--- a/generic/include/clc/clc.h
+++ b/generic/include/clc/clc.h
@@ -72,6 +72,7 @@
#include <clc/shared/max.h>
#include <clc/shared/min.h>
#include <clc/shared/vload.h>
+#include <clc/shared/vstore.h>
/* 6.11.5 Geometric Functions */
#include <clc/geometric/cross.h>
diff --git a/generic/include/clc/shared/vstore.h b/generic/include/clc/shared/vstore.h
new file mode 100644
index 0000000..1f784f8
--- /dev/null
+++ b/generic/include/clc/shared/vstore.h
@@ -0,0 +1,36 @@
+#define _CLC_VSTORE_DECL(PRIM_TYPE, VEC_TYPE, WIDTH, ADDR_SPACE) \
+ _CLC_OVERLOAD _CLC_DECL void vstore##WIDTH(VEC_TYPE vec, size_t offset, ADDR_SPACE PRIM_TYPE *out);
+
+#define _CLC_VECTOR_VSTORE_DECL(PRIM_TYPE, ADDR_SPACE) \
+ _CLC_VSTORE_DECL(PRIM_TYPE, PRIM_TYPE##2, 2, ADDR_SPACE) \
+ _CLC_VSTORE_DECL(PRIM_TYPE, PRIM_TYPE##3, 3, ADDR_SPACE) \
+ _CLC_VSTORE_DECL(PRIM_TYPE, PRIM_TYPE##4, 4, ADDR_SPACE) \
+ _CLC_VSTORE_DECL(PRIM_TYPE, PRIM_TYPE##8, 8, ADDR_SPACE) \
+ _CLC_VSTORE_DECL(PRIM_TYPE, PRIM_TYPE##16, 16, ADDR_SPACE)
+
+#define _CLC_VECTOR_VSTORE_PRIM1(PRIM_TYPE) \
+ _CLC_VECTOR_VSTORE_DECL(PRIM_TYPE, __private) \
+ _CLC_VECTOR_VSTORE_DECL(PRIM_TYPE, __local) \
+ _CLC_VECTOR_VSTORE_DECL(PRIM_TYPE, __global) \
+
+#define _CLC_VECTOR_VSTORE_PRIM() \
+ _CLC_VECTOR_VSTORE_PRIM1(char) \
+ _CLC_VECTOR_VSTORE_PRIM1(uchar) \
+ _CLC_VECTOR_VSTORE_PRIM1(short) \
+ _CLC_VECTOR_VSTORE_PRIM1(ushort) \
+ _CLC_VECTOR_VSTORE_PRIM1(int) \
+ _CLC_VECTOR_VSTORE_PRIM1(uint) \
+ _CLC_VECTOR_VSTORE_PRIM1(long) \
+ _CLC_VECTOR_VSTORE_PRIM1(ulong) \
+ _CLC_VECTOR_VSTORE_PRIM1(float) \
+
+#ifdef cl_khr_fp64
+#define _CLC_VECTOR_VSTORE() \
+ _CLC_VECTOR_VSTORE_PRIM1(double) \
+ _CLC_VECTOR_VSTORE_PRIM()
+#else
+#define _CLC_VECTOR_VSTORE() \
+ _CLC_VECTOR_VSTORE_PRIM()
+#endif
+
+_CLC_VECTOR_VSTORE()