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.
This commit is contained in:
Dam Sunwoo 2014-09-03 07:42:41 -04:00
parent 476c6fe368
commit 5008a20aa4

View 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);