From a679cd917ac4775979e23594de52f1bca407c08c Mon Sep 17 00:00:00 2001 From: Ali Saidi Date: Mon, 4 Apr 2011 11:42:28 -0500 Subject: ARM: Cleanup implementation of ITSTATE and put important code in PCState. Consolidate all code to handle ITSTATE in the PCState object rather than touching a variety of structures/objects. --- src/arch/arm/predecoder.hh | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) (limited to 'src/arch/arm/predecoder.hh') diff --git a/src/arch/arm/predecoder.hh b/src/arch/arm/predecoder.hh index 08e1676c0..e650d52d6 100644 --- a/src/arch/arm/predecoder.hh +++ b/src/arch/arm/predecoder.hh @@ -66,9 +66,8 @@ namespace ArmISA bool emiReady; bool outOfBytes; int offset; - ITSTATE itstate; - Addr predAddr; - bool predAddrValid; + bool foundIt; + ITSTATE itBits; public: void reset() @@ -78,15 +77,7 @@ namespace ArmISA emi = 0; emiReady = false; outOfBytes = true; - itstate = 0; - predAddr = 0; - predAddrValid = false; - } - - void reset(const ExtMachInst &old_emi) - { - reset(); - itstate = old_emi.newItstate; + foundIt = false; } Predecoder(ThreadContext * _tc) : @@ -106,7 +97,6 @@ namespace ArmISA tc = _tc; } - void advanceThumbCond(); void process(); //Use this to give data to the predecoder. This should be used @@ -149,11 +139,13 @@ namespace ArmISA assert(emiReady); ExtMachInst thisEmi = emi; pc.npc(pc.pc() + getInstSize()); - predAddrValid = true; - predAddr = pc.pc() + getInstSize(); + if (foundIt) + pc.nextItstate(itBits); + thisEmi.itstate = pc.itstate(); pc.size(getInstSize()); emi = 0; emiReady = false; + foundIt = false; return thisEmi; } }; -- cgit v1.2.3