From fb104cc926f9631c73019451df56f9f1fb40d2f9 Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Mon, 17 Feb 2020 10:41:58 +0000 Subject: [PATCH] arch, arch-arm: Use BaseISA in RenameMode interface Please note: we are still templatizing the RenameMode class to avoid virtual methods Change-Id: I4afd99f45eaa45be9e032b67e106884a21c83234 Signed-off-by: Giacomo Travaglini Reviewed-by: Nikos Nikoleris Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25429 Reviewed-by: Gabe Black Tested-by: kokoro --- src/arch/arm/isa.hh | 8 +++++--- src/arch/generic/traits.hh | 7 ++++--- 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/arch/arm/isa.hh b/src/arch/arm/isa.hh index e6173cf62..14ccb5cb8 100644 --- a/src/arch/arm/isa.hh +++ b/src/arch/arm/isa.hh @@ -776,9 +776,11 @@ template<> struct RenameMode { static Enums::VecRegRenameMode - init(const ArmISA::ISA* isa) + init(const BaseISA* isa) { - return isa->vecRegRenameMode(); + auto arm_isa = dynamic_cast(isa); + assert(arm_isa); + return arm_isa->vecRegRenameMode(); } static Enums::VecRegRenameMode @@ -792,7 +794,7 @@ struct RenameMode } static bool - equalsInit(const ArmISA::ISA* isa1, const ArmISA::ISA* isa2) + equalsInit(const BaseISA* isa1, const BaseISA* isa2) { return init(isa1) == init(isa2); } diff --git a/src/arch/generic/traits.hh b/src/arch/generic/traits.hh index c10fbcca3..53634198e 100644 --- a/src/arch/generic/traits.hh +++ b/src/arch/generic/traits.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2016 ARM Limited + * Copyright (c) 2016, 2020 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -40,6 +40,7 @@ #ifndef __ARCH_COMMON_TRAITS_HH__ #define __ARCH_COMMON_TRAITS_HH__ +#include "arch/generic/isa.hh" #include "arch/types.hh" #include "enums/VecRegRenameMode.hh" @@ -51,7 +52,7 @@ template struct RenameMode { - static Enums::VecRegRenameMode init(const ISA*) { return Enums::Full; } + static Enums::VecRegRenameMode init(const BaseISA*) { return Enums::Full; } static Enums::VecRegRenameMode mode(const TheISA::PCState&) @@ -61,7 +62,7 @@ struct RenameMode * Compare the initial rename mode of two instances of the ISA. * Result is true by definition, as the default mode is Full. * */ - static bool equalsInit(const ISA*, const ISA*) { return true; } + static bool equalsInit(const BaseISA*, const BaseISA*) { return true; } }; #endif /* __ARCH_COMMON_TRAITS_HH__ */ -- 2.30.2