LGTM, thanks. -----Original Message----- From: [email protected] [mailto:[email protected]] On Behalf Of Zhigang Gong Sent: Friday, September 13, 2013 6:34 PM To: [email protected] Cc: Zhigang Gong Subject: [Beignet] [PATCH] GBE: fixed the store3 bug.
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 <[email protected]> --- 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 _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet _______________________________________________ Beignet mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/beignet
