From 07b6f4261c462da995b60cb3cc1111edd910b56d Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Thu, 14 Jul 2022 11:06:57 +0100 Subject: [PATCH] arch-arm: Add undefined helper to ArmStaticInst In this way we can generate an Undefined Instruction fault from the instruction object without requiring to access its menmonic or opcode This is generalizing the existing disabledFault helper Change-Id: Ib7dec9399f142c35d75057f37ab53cce102fa01e Signed-off-by: Giacomo Travaglini Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61671 Reviewed-by: Andreas Sandberg Maintainer: Andreas Sandberg Tested-by: kokoro Reviewed-by: Richard Cooper --- src/arch/arm/insts/static_inst.hh | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/src/arch/arm/insts/static_inst.hh b/src/arch/arm/insts/static_inst.hh index e30ba28f7e..fa58f98de9 100644 --- a/src/arch/arm/insts/static_inst.hh +++ b/src/arch/arm/insts/static_inst.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2013,2016-2018 ARM Limited + * Copyright (c) 2010-2013,2016-2018, 2022 Arm Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -398,12 +398,7 @@ class ArmStaticInst : public StaticInst xc->pcState(pc); } - inline Fault - disabledFault() const - { - return std::make_shared(machInst, false, - mnemonic, true); - } + inline Fault disabledFault() const { return undefined(true); } // Utility function used by checkForWFxTrap32 and checkForWFxTrap64 // Returns true if processor has to trap a WFI/WFE instruction. @@ -587,6 +582,13 @@ class ArmStaticInst : public StaticInst { return getCurSveVecLenInBits(tc) / (8 * sizeof(T)); } + + inline Fault + undefined(bool disabled=false) const + { + return std::make_shared( + machInst, false, mnemonic, disabled); + } }; } // namespace ArmISA