From b1623cb2087873f64197e503ab8894b5e4d4c7b4 Mon Sep 17 00:00:00 2001 From: Jordi Vaquero Date: Tue, 21 Apr 2020 15:37:33 +0200 Subject: [PATCH] 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 --- src/arch/generic/vec_reg.hh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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: -- 2.30.2