cpu: fix bimodal predictor to use correct global history reg
authorDam Sunwoo <dam.sunwoo@arm.com>
Wed, 3 Sep 2014 11:42:41 +0000 (07:42 -0400)
committerDam Sunwoo <dam.sunwoo@arm.com>
Wed, 3 Sep 2014 11:42:41 +0000 (07:42 -0400)
A small bug in the bimodal predictor caused significant degradation in
performance on some benchmarks. This was caused by using the wrong
globalHistoryReg during the update phase. This patches fixes the bug
and brings the performance to normal level.

src/cpu/pred/bi_mode.cc

index cb4365ed588dccb3a91607e5ded303fbe1e570fe..604afee55dbcee661c77b85ff7615530b05e695f 100644 (file)
@@ -167,7 +167,7 @@ BiModeBP::update(Addr branchAddr, bool taken, void *bpHistory, bool squashed)
         unsigned choiceHistoryIdx = ((branchAddr >> instShiftAmt)
                                     & choiceHistoryMask);
         unsigned globalHistoryIdx = (((branchAddr >> instShiftAmt)
-                                    ^ globalHistoryReg)
+                                    ^ history->globalHistoryReg)
                                     & globalHistoryMask);
 
         assert(choiceHistoryIdx < choicePredictorSize);