From: Dam Sunwoo Date: Wed, 3 Sep 2014 11:42:41 +0000 (-0400) Subject: cpu: fix bimodal predictor to use correct global history reg X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5008a20aa4585f052c145a0d6d72c5aab75e77a7;p=gem5.git cpu: fix bimodal predictor to use correct global history reg 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. --- diff --git a/src/cpu/pred/bi_mode.cc b/src/cpu/pred/bi_mode.cc index cb4365ed5..604afee55 100644 --- a/src/cpu/pred/bi_mode.cc +++ b/src/cpu/pred/bi_mode.cc @@ -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);