summaryrefslogtreecommitdiff
path: root/src/arch/arm/predecoder.cc
diff options
context:
space:
mode:
authorAli Saidi <Ali.Saidi@ARM.com>2011-04-04 11:42:28 -0500
committerAli Saidi <Ali.Saidi@ARM.com>2011-04-04 11:42:28 -0500
commita679cd917ac4775979e23594de52f1bca407c08c (patch)
treed48bb74b729d2e11e62e1db9a4fb860b70ddd1b3 /src/arch/arm/predecoder.cc
parentac650199eeb62bf05fec11a4f2d7666cbd31331c (diff)
downloadgem5-a679cd917ac4775979e23594de52f1bca407c08c.tar.xz
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.
Diffstat (limited to 'src/arch/arm/predecoder.cc')
-rw-r--r--src/arch/arm/predecoder.cc52
1 files changed, 3 insertions, 49 deletions
diff --git a/src/arch/arm/predecoder.cc b/src/arch/arm/predecoder.cc
index e532359b5..b87ca622e 100644
--- a/src/arch/arm/predecoder.cc
+++ b/src/arch/arm/predecoder.cc
@@ -51,27 +51,6 @@ namespace ArmISA
{
void
-Predecoder::advanceThumbCond()
-{
- uint8_t condMask = itstate.mask;
- uint8_t thumbCond = itstate.cond;
- DPRINTF(Predecoder, "Advancing ITSTATE from %#x, %#x.\n",
- thumbCond, condMask);
- condMask = condMask << 1;
- uint8_t newBit = bits(condMask, 4);
- condMask &= mask(4);
- if (condMask == 0) {
- thumbCond = 0;
- } else {
- replaceBits(thumbCond, 0, newBit);
- }
- DPRINTF(Predecoder, "Advancing ITSTATE to %#x, %#x.\n",
- thumbCond, condMask);
- itstate.mask = condMask;
- itstate.cond = thumbCond;
-}
-
-void
Predecoder::process()
{
// emi is typically ready, with some caveats below...
@@ -93,11 +72,6 @@ Predecoder::process()
consumeBytes(2);
DPRINTF(Predecoder, "Second half of 32 bit Thumb: %#x.\n",
emi.instBits);
- if (itstate.mask) {
- emi.itstate = itstate;
- advanceThumbCond();
- emi.newItstate = itstate;
- }
} else {
uint16_t highBits = word & 0xF800;
if (highBits == 0xE800 || highBits == 0xF000 ||
@@ -110,11 +84,6 @@ Predecoder::process()
DPRINTF(Predecoder, "All of 32 bit Thumb: %#x.\n",
emi.instBits);
consumeBytes(4);
- if (itstate.mask) {
- emi.itstate = itstate;
- advanceThumbCond();
- emi.newItstate = itstate;
- }
} else {
// We only have the first half word.
DPRINTF(Predecoder,
@@ -135,16 +104,11 @@ Predecoder::process()
emi.instBits);
if (bits(word, 15, 8) == 0xbf &&
bits(word, 3, 0) != 0x0) {
- emi.itstate = itstate;
- itstate = bits(word, 7, 0);
- emi.newItstate = itstate;
+ foundIt = true;
+ itBits = bits(word, 7, 0);
DPRINTF(Predecoder,
"IT detected, cond = %#x, mask = %#x\n",
- itstate.cond, itstate.mask);
- } else if (itstate.mask) {
- emi.itstate = itstate;
- advanceThumbCond();
- emi.newItstate = itstate;
+ itBits.cond, itBits.mask);
}
}
}
@@ -163,16 +127,6 @@ Predecoder::moreBytes(const PCState &pc, Addr fetchPC, MachInst inst)
emi.fpscrLen = fpscr.len;
emi.fpscrStride = fpscr.stride;
- if (pc.forcedItStateIsValid()) {
- // returns from exceptions/interrupts force the it state.
- itstate = pc.forcedItState();
- DPRINTF(Predecoder, "Predecoder, itstate forced = %08x.\n", pc.forcedItState());
- } else if (predAddrValid && (pc.instAddr() != predAddr)) {
- // Control flow changes necessitate a 0 itstate.
- itstate.top6 = 0;
- itstate.bottom2 = 0;
- }
-
outOfBytes = false;
process();
}