[Beignet] [PATCH V2 1/3] GBE: make vload3 only read 3 elements.

Yang, Rong R rong.r.yang at intel.com
Thu Mar 6 22:19:01 PST 2014


The patchset LGTM, thanks.

-----Original Message-----
From: beignet-bounces at lists.freedesktop.org [mailto:beignet-bounces at lists.freedesktop.org] On Behalf Of Ruiling Song
Sent: Friday, March 07, 2014 1:49 PM
To: beignet at lists.freedesktop.org
Cc: Song, Ruiling
Subject: [Beignet] [PATCH V2 1/3] GBE: make vload3 only read 3 elements.

clang will align the vec3 load into vec4. we have to do it in frontend.

Signed-off-by: Ruiling Song <ruiling.song at intel.com>
---
 backend/src/ocl_stdlib.tmpl.h |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/backend/src/ocl_stdlib.tmpl.h b/backend/src/ocl_stdlib.tmpl.h index 76395fa..e3ac632 100755
--- a/backend/src/ocl_stdlib.tmpl.h
+++ b/backend/src/ocl_stdlib.tmpl.h
@@ -3854,12 +3854,12 @@ INLINE_OVERLOADABLE void vstore3(TYPE##3 v, size_t offset, SPACE TYPE *p) {\
   *(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); \
+  return (TYPE##3)(*(p + 3 * offset), *(p+ 3 * offset + 1), *(p + 3 * 
+ offset + 2));\
 }
 
 #define DECL_UNTYPED_RDV3_SPACE(TYPE, SPACE) \  INLINE_OVERLOADABLE TYPE##3 vload3(size_t offset, const SPACE TYPE *p) { \
-  return *(SPACE TYPE##3 *) (p + 3 * offset); \
+  return (TYPE##3)(*(p + 3 * offset), *(p+ 3 * offset + 1), *(p + 3 * 
+ offset + 2));\
 }
 
 #define DECL_UNTYPED_RW_ALL_SPACE(TYPE, SPACE) \
--
1.7.9.5

_______________________________________________
Beignet mailing list
Beignet at lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list