484,490c484,485
< int instSize = sizeof(TheISA::MachInst);
< bool branch_taken =
< !(inst->readNextPC() + instSize == inst->readNextNPC() &&
< (inst->readNextPC() == inst->readPC() + instSize ||
< inst->readNextPC() == inst->readPC() + 2 * instSize));
< DPRINTF(Sparc, "Branch taken = %s [sn:%i]\n",
< branch_taken ? "true": "false", inst->seqNum);
---
> bool branch_taken = inst->readNextNPC() !=
> (inst->readNextPC() + sizeof(TheISA::MachInst));
494,502c489,491
< bool squashDelaySlot = true;
< // (inst->readNextPC() != inst->readPC() + sizeof(TheISA::MachInst));
< DPRINTF(Sparc, "Squash delay slot = %s [sn:%i]\n",
< squashDelaySlot ? "true": "false", inst->seqNum);
< toCommit->squashDelaySlot[tid] = squashDelaySlot;
< //If we're squashing the delay slot, we need to pick back up at NextPC.
< //Otherwise, NextPC isn't being squashed, so we should pick back up at
< //NextNPC.
< if (squashDelaySlot) {
---
> toCommit->condDelaySlotBranch[tid] = inst->isCondDelaySlot();
>
> if (inst->isCondDelaySlot() && branch_taken) {
504,505c493
< toCommit->nextNPC[tid] = inst->readNextNPC();
< } else
---
> } else {
506a495
> }
528,530c517
< #if ISA_HAS_DELAY_SLOT
< toCommit->nextNPC[tid] = inst->readNextNPC();
< #endif
---
> toCommit->branchMispredict[tid] = false;
547,549c534
< #if ISA_HAS_DELAY_SLOT
< toCommit->nextNPC[tid] = inst->readNextNPC();
< #endif
---
> toCommit->branchMispredict[tid] = false;
689c674,675
< std::list<unsigned>::iterator threads = (*activeThreads).begin();
---
> std::list<unsigned>::iterator threads = activeThreads->begin();
> std::list<unsigned>::iterator end = activeThreads->end();
691,692c677,679
< while (threads != (*activeThreads).end()) {
< unsigned thread_count = skidBuffer[*threads++].size();
---
> while (threads != end) {
> unsigned tid = *threads++;
> unsigned thread_count = skidBuffer[tid].size();
704c691,692
< std::list<unsigned>::iterator threads = (*activeThreads).begin();
---
> std::list<unsigned>::iterator threads = activeThreads->begin();
> std::list<unsigned>::iterator end = activeThreads->end();
706,707c694,697
< while (threads != (*activeThreads).end()) {
< if (!skidBuffer[*threads++].empty())
---
> while (threads != end) {
> unsigned tid = *threads++;
>
> if (!skidBuffer[tid].empty())
720c710,711
< std::list<unsigned>::iterator threads = (*activeThreads).begin();
---
> std::list<unsigned>::iterator threads = activeThreads->begin();
> std::list<unsigned>::iterator end = activeThreads->end();
722,724c713
< threads = (*activeThreads).begin();
<
< while (threads != (*activeThreads).end()) {
---
> while (threads != end) {
1244c1233,1234
< std::list<unsigned>::iterator threads = (*activeThreads).begin();
---
> std::list<unsigned>::iterator threads = activeThreads->begin();
> std::list<unsigned>::iterator end = activeThreads->end();
1246c1236
< while (threads != (*activeThreads).end()) {
---
> while (threads != end) {
1311c1301,1302
< DPRINTF(IEW, "Store has fault! [sn:%lli]\n", inst->seqNum);
---
> DPRINTF(IEW, "Store has fault %s! [sn:%lli]\n",
> fault->name(), inst->seqNum);
1348c1339,1340
< if (!fetchRedirect[tid]) {
---
> if (!fetchRedirect[tid] ||
> toCommit->squashedSeqNum[tid] > inst->seqNum) {
1354d1345
< DPRINTF(IEW, "Predicted target was %#x.\n", inst->predPC);
1365c1356
< if (inst->readPredTaken()) {
---
> if (inst->predTaken()) {
1371,1372d1361
< fetchRedirect[tid] = true;
<
1382a1372,1379
> // Ensure the violating instruction is older than
> // current squash
> if (fetchRedirect[tid] &&
> violator->seqNum >= toCommit->squashedSeqNum[tid])
> continue;
>
> fetchRedirect[tid] = true;
>
1480c1477,1478
< std::list<unsigned>::iterator threads = (*activeThreads).begin();
---
> std::list<unsigned>::iterator threads = activeThreads->begin();
> std::list<unsigned>::iterator end = activeThreads->end();
1483,1484c1481,1482
< while (threads != (*activeThreads).end()) {
< unsigned tid = *threads++;
---
> while (threads != end) {
> unsigned tid = *threads++;
1524,1525c1522,1523
< threads = (*activeThreads).begin();
< while (threads != (*activeThreads).end()) {
---
> threads = activeThreads->begin();
> while (threads != end) {