Jordi Vaquero has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/27968 )

Change subject: arch: Fix VecReg container alignement to 128bits view
......................................................................

arch: Fix VecReg container alignement to 128bits view

This Patch will fix the alignment problem that appears sometimes
when we try to create a view of 128 bits over the VecRegContainer
object.

That container is initially created as std::array<uint8_t, SIZE>, so
there is no obligation to be aligned to 16 bytes. This patches forces
all containers to be aligned to 16 bytes.

The problem has been observed in the Jira Issue:
https://gem5.atlassian.net/browse/GEM5-320

Change-Id: Id9fdd427bd7a4dc904edd519f31cc29c5b29c5e6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/27968
Reviewed-by: Jason Lowe-Power <power...@gmail.com>
Reviewed-by: Ciro Santilli <ciro.santi...@arm.com>
Maintainer: Jason Lowe-Power <power...@gmail.com>
Tested-by: kokoro <noreply+kok...@google.com>
---
M src/arch/generic/vec_reg.hh
1 file changed, 2 insertions(+), 1 deletion(-)

Approvals:
  Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
  Ciro Santilli: Looks good to me, but someone else must approve
  kokoro: Regressions pass



diff --git a/src/arch/generic/vec_reg.hh b/src/arch/generic/vec_reg.hh
index 4156ac5..e26cf8b 100644
--- a/src/arch/generic/vec_reg.hh
+++ b/src/arch/generic/vec_reg.hh
@@ -279,7 +279,8 @@
     static constexpr inline size_t size() { return SIZE; };
     using Container = std::array<uint8_t, SIZE>;
   private:
-    Container container;
+    // 16-byte aligned to support 128bit element view
+    alignas(16) Container container;
     using MyClass = VecRegContainer<SIZE>;

   public:

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/27968
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Id9fdd427bd7a4dc904edd519f31cc29c5b29c5e6
Gerrit-Change-Number: 27968
Gerrit-PatchSet: 2
Gerrit-Owner: Jordi Vaquero <jordi.vaqu...@metempsy.com>
Gerrit-Reviewer: Bobby R. Bruce <bbr...@ucdavis.edu>
Gerrit-Reviewer: Ciro Santilli <ciro.santi...@arm.com>
Gerrit-Reviewer: Daniel Carvalho <oda...@yahoo.com.br>
Gerrit-Reviewer: Giacomo Travaglini <giacomo.travagl...@arm.com>
Gerrit-Reviewer: Jason Lowe-Power <power...@gmail.com>
Gerrit-Reviewer: Jordi Vaquero <jordi.vaqu...@metempsy.com>
Gerrit-Reviewer: Victor Soria <victor.so...@bsc.es>
Gerrit-Reviewer: kokoro <noreply+kok...@google.com>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- gem5-dev@gem5.org
To unsubscribe send an email to gem5-dev-le...@gem5.org
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to