summaryrefslogtreecommitdiff
path: root/src/cpu/o3/fetch_impl.hh
diff options
context:
space:
mode:
authorMatt Horsnell <Matt.Horsnell@arm.com>2011-01-18 16:30:05 -0600
committerMatt Horsnell <Matt.Horsnell@arm.com>2011-01-18 16:30:05 -0600
commit62f2097917c977335d025e230146c6eb56a9bb5d (patch)
tree68bc1883947fb893961ea2474903ed1de1a40007 /src/cpu/o3/fetch_impl.hh
parent5ebf3b280867925917654f5362d3ece21dc2355e (diff)
downloadgem5-62f2097917c977335d025e230146c6eb56a9bb5d.tar.xz
O3: Fix mispredicts from non control instructions.
The squash inside the fetch unit should not attempt to remove them from the branch predictor as non-control instructions are not pushed into the predictor.
Diffstat (limited to 'src/cpu/o3/fetch_impl.hh')
-rw-r--r--src/cpu/o3/fetch_impl.hh10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh
index 880158dfc..736a66c64 100644
--- a/src/cpu/o3/fetch_impl.hh
+++ b/src/cpu/o3/fetch_impl.hh
@@ -902,8 +902,14 @@ DefaultFetch<Impl>::checkSignalsAndUpdate(ThreadID tid)
fromCommit->commitInfo[tid].doneSeqNum,
tid);
- // Also check if there's a mispredict that happened.
- if (fromCommit->commitInfo[tid].branchMispredict) {
+ // If it was a branch mispredict on a control instruction, update the
+ // branch predictor with that instruction, otherwise just kill the
+ // invalid state we generated in after sequence number
+ assert(!fromCommit->commitInfo[tid].branchMispredict ||
+ fromCommit->commitInfo[tid].mispredictInst);
+
+ if (fromCommit->commitInfo[tid].branchMispredict &&
+ fromCommit->commitInfo[tid].mispredictInst->isControl()) {
branchPred.squash(fromCommit->commitInfo[tid].doneSeqNum,
fromCommit->commitInfo[tid].pc,
fromCommit->commitInfo[tid].branchTaken,