From 16253e494e9275fb62d900d0f5f7bc7216fd8b3a Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Thu, 21 Oct 2021 09:56:23 +0100 Subject: [PATCH] arch: Fixed Packed register view for VecPredReg A bug in the VecPredRegContainer::as method was introduced by a past commit [1]. The commit was not properly handling the case of a Packed representation If Packed == true -> NumElement = NumBits instead of NumElements = NumBits / sizeof(VecElem) This patch is fixing it [1]: https://gem5-review.googlesource.com/c/public/gem5/+/42000 Change-Id: I308769c3938d0fac84316936f732a6c383146484 Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51867 Reviewed-by: Jason Lowe-Power Maintainer: Jason Lowe-Power Tested-by: kokoro --- src/arch/generic/vec_pred_reg.hh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/arch/generic/vec_pred_reg.hh b/src/arch/generic/vec_pred_reg.hh index eb96949eba..ad6bcceff1 100644 --- a/src/arch/generic/vec_pred_reg.hh +++ b/src/arch/generic/vec_pred_reg.hh @@ -1,4 +1,4 @@ -// Copyright (c) 2017 ARM Limited +// Copyright (c) 2017, 2021 Arm Limited // All rights reserved // // The license below extends only to copyright in the software and shall @@ -344,23 +344,25 @@ class VecPredRegContainer /// @tparam VecElem Type of the vector elements. /// @{ template - VecPredRegT + auto as() const { static_assert(NumBits % sizeof(VecElem) == 0, "Container size incompatible with view size."); - return VecPredRegT( - *this); + return VecPredRegT(*this); } template - VecPredRegT + auto as() { static_assert(NumBits % sizeof(VecElem) == 0, "Container size incompatible with view size."); - return VecPredRegT( - *this); + return VecPredRegT(*this); } /// @} };