diff options
| author | Tom Stellard <thomas.stellard@amd.com> | 2013-06-26 18:22:11 +0000 |
|---|---|---|
| committer | Tom Stellard <thomas.stellard@amd.com> | 2013-06-26 18:22:11 +0000 |
| commit | 51441f80c55fa7719d11b4dff73d4e9132729234 (patch) | |
| tree | 3844be2caaeacd41cd6cd16037355a2ddd8fa94e /libclc/generic/include/clc/shared | |
| parent | 66ecbc7c18f4f923b41ead5f2177ff5f64b5df57 (diff) | |
| download | bcm5719-llvm-51441f80c55fa7719d11b4dff73d4e9132729234.tar.gz bcm5719-llvm-51441f80c55fa7719d11b4dff73d4e9132729234.zip | |
libclc: Initial vstore implementation
Assumes that the target supports byte-addressable stores.
Completely unoptimized.
Patch by: Aaron Watry
llvm-svn: 185007
Diffstat (limited to 'libclc/generic/include/clc/shared')
| -rw-r--r-- | libclc/generic/include/clc/shared/vstore.h | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/libclc/generic/include/clc/shared/vstore.h b/libclc/generic/include/clc/shared/vstore.h new file mode 100644 index 00000000000..1f784f82fec --- /dev/null +++ b/libclc/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() |

