[RISCV] Fix mgather -> riscv.masked.strided.load combine not extending indices (...
[llvm-project.git] / libclc / generic / include / clc / shared / vstore.h
blobebad3301b1ed59c869d930dc4fc85cb1c1628aa8
1 #define _CLC_VSTORE_DECL(SUFFIX, PRIM_TYPE, VEC_TYPE, WIDTH, ADDR_SPACE, RND) \
2 _CLC_OVERLOAD _CLC_DECL void vstore##SUFFIX##WIDTH##RND(VEC_TYPE vec, size_t offset, ADDR_SPACE PRIM_TYPE *out);
4 #define _CLC_VECTOR_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, ADDR_SPACE, RND) \
5 _CLC_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##2, 2, ADDR_SPACE, RND) \
6 _CLC_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##3, 3, ADDR_SPACE, RND) \
7 _CLC_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##4, 4, ADDR_SPACE, RND) \
8 _CLC_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##8, 8, ADDR_SPACE, RND) \
9 _CLC_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE##16, 16, ADDR_SPACE, RND)
11 #define _CLC_VECTOR_VSTORE_PRIM3(SUFFIX, MEM_TYPE, PRIM_TYPE, RND) \
12 _CLC_VECTOR_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __private, RND) \
13 _CLC_VECTOR_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __local, RND) \
14 _CLC_VECTOR_VSTORE_DECL(SUFFIX, MEM_TYPE, PRIM_TYPE, __global, RND)
16 #define _CLC_VECTOR_VSTORE_PRIM1(PRIM_TYPE) \
17 _CLC_VECTOR_VSTORE_PRIM3(,PRIM_TYPE, PRIM_TYPE, )
19 #define _CLC_VECTOR_VSTORE_HALF_PRIM1(PRIM_TYPE, RND) \
20 _CLC_VSTORE_DECL(_half, half, PRIM_TYPE, , __private, RND) \
21 _CLC_VSTORE_DECL(_half, half, PRIM_TYPE, , __local, RND) \
22 _CLC_VSTORE_DECL(_half, half, PRIM_TYPE, , __global, RND) \
23 _CLC_VECTOR_VSTORE_PRIM3(_half, half, PRIM_TYPE, RND) \
24 _CLC_VSTORE_DECL(a_half, half, PRIM_TYPE, , __private, RND) \
25 _CLC_VSTORE_DECL(a_half, half, PRIM_TYPE, , __local, RND) \
26 _CLC_VSTORE_DECL(a_half, half, PRIM_TYPE, , __global, RND) \
27 _CLC_VECTOR_VSTORE_PRIM3(a_half, half, PRIM_TYPE, RND)
29 _CLC_VECTOR_VSTORE_PRIM1(char)
30 _CLC_VECTOR_VSTORE_PRIM1(uchar)
31 _CLC_VECTOR_VSTORE_PRIM1(short)
32 _CLC_VECTOR_VSTORE_PRIM1(ushort)
33 _CLC_VECTOR_VSTORE_PRIM1(int)
34 _CLC_VECTOR_VSTORE_PRIM1(uint)
35 _CLC_VECTOR_VSTORE_PRIM1(long)
36 _CLC_VECTOR_VSTORE_PRIM1(ulong)
37 _CLC_VECTOR_VSTORE_PRIM1(float)
39 _CLC_VECTOR_VSTORE_HALF_PRIM1(float,)
40 _CLC_VECTOR_VSTORE_HALF_PRIM1(float, _rtz)
41 _CLC_VECTOR_VSTORE_HALF_PRIM1(float, _rtn)
42 _CLC_VECTOR_VSTORE_HALF_PRIM1(float, _rtp)
43 _CLC_VECTOR_VSTORE_HALF_PRIM1(float, _rte)
45 #ifdef cl_khr_fp64
46 _CLC_VECTOR_VSTORE_PRIM1(double)
47 _CLC_VECTOR_VSTORE_HALF_PRIM1(double,)
48 _CLC_VECTOR_VSTORE_HALF_PRIM1(double, _rtz)
49 _CLC_VECTOR_VSTORE_HALF_PRIM1(double, _rtn)
50 _CLC_VECTOR_VSTORE_HALF_PRIM1(double, _rtp)
51 _CLC_VECTOR_VSTORE_HALF_PRIM1(double, _rte)
52 #endif
54 #ifdef cl_khr_fp16
55 _CLC_VECTOR_VSTORE_PRIM1(half)
56 #endif
59 #undef _CLC_VSTORE_DECL
60 #undef _CLC_VECTOR_VSTORE_DECL
61 #undef _CLC_VECTOR_VSTORE_PRIM3
62 #undef _CLC_VECTOR_VSTORE_PRIM1