From: Jordi Vaquero Date: Tue, 21 Apr 2020 13:37:33 +0000 (+0200) Subject: arch: Fix VecReg container alignement to 128bits view X-Git-Tag: v20.0.0.0~165 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=b1623cb2087873f64197e503ab8894b5e4d4c7b4;p=gem5.git 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, 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 Reviewed-by: Ciro Santilli Maintainer: Jason Lowe-Power Tested-by: kokoro --- diff --git a/src/arch/generic/vec_reg.hh b/src/arch/generic/vec_reg.hh index 4156ac5ef..e26cf8b2c 100644 --- a/src/arch/generic/vec_reg.hh +++ b/src/arch/generic/vec_reg.hh @@ -279,7 +279,8 @@ class VecRegContainer static constexpr inline size_t size() { return SIZE; }; using Container = std::array; private: - Container container; + // 16-byte aligned to support 128bit element view + alignas(16) Container container; using MyClass = VecRegContainer; public: