From 725b19a8154fa557ab3057f07d7cd3c6d798789d Mon Sep 17 00:00:00 2001 From: Rico Amslinger Date: Thu, 24 Aug 2017 15:07:44 +0200 Subject: [PATCH] cpu: Fix bi-mode branch predictor thresholds When different sizes were set for the choice and global saturation counter (e.g. ex5_big), the threshold calculation used the wrong size. Thus the branch predictor always predicted "not taken" for choice > global. Change-Id: I076549ff1482e2280cef24a0d16b7bb2122d4110 Reviewed-on: https://gem5-review.googlesource.com/4560 Reviewed-by: Curtis Dunham Maintainer: Jason Lowe-Power --- src/cpu/pred/bi_mode.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/cpu/pred/bi_mode.cc b/src/cpu/pred/bi_mode.cc index 69af4584a..e8fda7387 100644 --- a/src/cpu/pred/bi_mode.cc +++ b/src/cpu/pred/bi_mode.cc @@ -68,8 +68,8 @@ BiModeBP::BiModeBP(const BiModeBPParams *params) globalHistoryMask = globalPredictorSize - 1; choiceThreshold = (ULL(1) << (choiceCtrBits - 1)) - 1; - takenThreshold = (ULL(1) << (choiceCtrBits - 1)) - 1; - notTakenThreshold = (ULL(1) << (choiceCtrBits - 1)) - 1; + takenThreshold = (ULL(1) << (globalCtrBits - 1)) - 1; + notTakenThreshold = (ULL(1) << (globalCtrBits - 1)) - 1; } /* -- 2.30.2