[Beignet] [PATCH] GBE: fixed the store3 bug.
Zhigang Gong
zhigang.gong at linux.intel.com
Fri Sep 13 03:33:43 PDT 2013
As the llvm will convert a type3 pointer to a type4 pointer
completely, we can't check whether a store is a type3 or type4
We have to do this in the front end.
Signed-off-by: Zhigang Gong <zhigang.gong at linux.intel.com>
---
backend/src/ocl_stdlib.tmpl.h | 12 +++++++++++-
1 file changed, 11 insertions(+), 1 deletion(-)
diff --git a/backend/src/ocl_stdlib.tmpl.h b/backend/src/ocl_stdlib.tmpl.h
index a15a4dd..26ceb90 100644
--- a/backend/src/ocl_stdlib.tmpl.h
+++ b/backend/src/ocl_stdlib.tmpl.h
@@ -1752,9 +1752,19 @@ INLINE_OVERLOADABLE void vstore##DIM(TYPE##DIM v, size_t offset, SPACE TYPE *p)
*(SPACE TYPE##DIM *) (p + DIM * offset) = v; \
}
+#define DECL_UNTYPED_V3_SPACE(TYPE, SPACE) \
+INLINE_OVERLOADABLE void vstore3(TYPE##3 v, size_t offset, SPACE TYPE *p) {\
+ *(p + 3 * offset) = v.s0; \
+ *(p + 3 * offset + 1) = v.s1; \
+ *(p + 3 * offset + 2) = v.s2; \
+} \
+INLINE_OVERLOADABLE TYPE##3 vload3(size_t offset, const SPACE TYPE *p) { \
+ return *(SPACE TYPE##3 *) (p + 3 * offset); \
+}
+
#define DECL_UNTYPED_RW_ALL_SPACE(TYPE, SPACE) \
DECL_UNTYPED_RW_SPACE_N(TYPE, 2, SPACE) \
- DECL_UNTYPED_RW_SPACE_N(TYPE, 3, SPACE) \
+ DECL_UNTYPED_V3_SPACE(TYPE, SPACE) \
DECL_UNTYPED_RW_SPACE_N(TYPE, 4, SPACE) \
DECL_UNTYPED_RW_SPACE_N(TYPE, 8, SPACE) \
DECL_UNTYPED_RW_SPACE_N(TYPE, 16, SPACE)
--
1.7.9.5
More information about the Beignet
mailing list