From 62f2097917c977335d025e230146c6eb56a9bb5d Mon Sep 17 00:00:00 2001 From: Matt Horsnell Date: Tue, 18 Jan 2011 16:30:05 -0600 Subject: 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. --- src/cpu/o3/fetch_impl.hh | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'src/cpu/o3/fetch_impl.hh') 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::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, -- cgit v1.2.3