[Libclc-dev] [PATCH 4/9] r600: Enable vstore3 assembly path for int/uint/float

Aaron Watry awatry at gmail.com
Tue Jul 22 18:46:45 PDT 2014


This works now, at least on the cedar (EG) and pitcairn (SI) cards I tested.

Signed-off-by: Aaron Watry <awatry at gmail.com>
---
 r600/lib/shared/vstore.cl | 26 ++------------------------
 1 file changed, 2 insertions(+), 24 deletions(-)

diff --git a/r600/lib/shared/vstore.cl b/r600/lib/shared/vstore.cl
index 51890ed..ce67b75 100644
--- a/r600/lib/shared/vstore.cl
+++ b/r600/lib/shared/vstore.cl
@@ -57,29 +57,10 @@ VSTORE_VECTORIZE(uint, __local)
 VSTORE_VECTORIZE(float, __private)
 VSTORE_VECTORIZE(float, __local)
 
-_CLC_OVERLOAD _CLC_DEF void vstore3(int3 vec, size_t offset, global int *mem) {
-    mem[3*offset] = vec.s0;
-    mem[3*offset+1] = vec.s1;
-    mem[3*offset+2] = vec.s2;
-}
-_CLC_OVERLOAD _CLC_DEF void vstore3(uint3 vec, size_t offset, global uint *mem) {
-    mem[3*offset] = vec.s0;
-    mem[3*offset+1] = vec.s1;
-    mem[3*offset+2] = vec.s2;
-}
-_CLC_OVERLOAD _CLC_DEF void vstore3(float3 vec, size_t offset, global float *mem) {
-    mem[3*offset] = vec.s0;
-    mem[3*offset+1] = vec.s1;
-    mem[3*offset+2] = vec.s2;
-}
-
-/*Note: R600 doesn't support store <3 x ?>... so
- * those functions aren't actually overridden here... lowest-common-denominator
- */
-
 //We only define functions for signed_type vstoreN(), and then just cast the pointers/vectors for unsigned types
 #define _CLC_VSTORE_ASM_DECL(PRIM_TYPE,LLVM_SCALAR_TYPE,ADDR_SPACE,ADDR_SPACE_ID) \
 _CLC_DECL void __clc_vstore2_##LLVM_SCALAR_TYPE##__addr##ADDR_SPACE_ID (PRIM_TYPE##2, ADDR_SPACE PRIM_TYPE *); \
+_CLC_DECL void __clc_vstore3_##LLVM_SCALAR_TYPE##__addr##ADDR_SPACE_ID (PRIM_TYPE##3, ADDR_SPACE PRIM_TYPE *); \
 _CLC_DECL void __clc_vstore4_##LLVM_SCALAR_TYPE##__addr##ADDR_SPACE_ID (PRIM_TYPE##4, ADDR_SPACE PRIM_TYPE *); \
 _CLC_DECL void __clc_vstore8_##LLVM_SCALAR_TYPE##__addr##ADDR_SPACE_ID (PRIM_TYPE##8, ADDR_SPACE PRIM_TYPE *); \
 _CLC_DECL void __clc_vstore16_##LLVM_SCALAR_TYPE##__addr##ADDR_SPACE_ID (PRIM_TYPE##16, ADDR_SPACE PRIM_TYPE *); \
@@ -89,12 +70,9 @@ _CLC_DECL void __clc_vstore16_##LLVM_SCALAR_TYPE##__addr##ADDR_SPACE_ID (PRIM_TY
     __clc_vstore##VEC_WIDTH##_##LLVM_SCALAR_TYPE##__addr##ADDR_SPACE_ID (__builtin_astype(vec, S_PRIM_TYPE##VEC_WIDTH), (ADDR_SPACE S_PRIM_TYPE *)&x[ VEC_WIDTH * offset]); \
   } \
 
-/*Note: R600 back-end doesn't support store <3 x ?>... so
- * those functions aren't actually overridden here... When the back-end supports
- * that, then clean add here, and remove the vstore3 definitions from above.
- */
 #define _CLC_VSTORE_ASM_OVERLOAD_SIZES(PRIM_TYPE,S_PRIM_TYPE,LLVM_TYPE,ADDR_SPACE,ADDR_SPACE_ID) \
   _CLC_VSTORE_ASM_DEFINE(PRIM_TYPE, S_PRIM_TYPE, LLVM_TYPE, 2, ADDR_SPACE, ADDR_SPACE_ID) \
+  _CLC_VSTORE_ASM_DEFINE(PRIM_TYPE, S_PRIM_TYPE, LLVM_TYPE, 3, ADDR_SPACE, ADDR_SPACE_ID) \
   _CLC_VSTORE_ASM_DEFINE(PRIM_TYPE, S_PRIM_TYPE, LLVM_TYPE, 4, ADDR_SPACE, ADDR_SPACE_ID) \
   _CLC_VSTORE_ASM_DEFINE(PRIM_TYPE, S_PRIM_TYPE, LLVM_TYPE, 8, ADDR_SPACE, ADDR_SPACE_ID) \
   _CLC_VSTORE_ASM_DEFINE(PRIM_TYPE, S_PRIM_TYPE, LLVM_TYPE, 16, ADDR_SPACE, ADDR_SPACE_ID) \
-- 
1.9.1





More information about the Libclc-dev mailing list