diff options
Diffstat (limited to 'cpu/beta_cpu/2bit_local_pred.cc')
-rw-r--r-- | cpu/beta_cpu/2bit_local_pred.cc | 34 |
1 files changed, 15 insertions, 19 deletions
diff --git a/cpu/beta_cpu/2bit_local_pred.cc b/cpu/beta_cpu/2bit_local_pred.cc index e5bf9647f..bcd3ba00d 100644 --- a/cpu/beta_cpu/2bit_local_pred.cc +++ b/cpu/beta_cpu/2bit_local_pred.cc @@ -30,21 +30,6 @@ DefaultBP::DefaultBP(unsigned _localPredictorSize, instShiftAmt); } -inline -bool -DefaultBP::getPrediction(uint8_t &count) -{ - // Get the MSB of the count - return (count >> (localCtrBits - 1)); -} - -inline -unsigned -DefaultBP::getLocalIndex(Addr &branch_addr) -{ - return (branch_addr >> instShiftAmt) & indexMask; -} - bool DefaultBP::lookup(Addr &branch_addr) { @@ -91,15 +76,26 @@ DefaultBP::update(Addr &branch_addr, bool taken) assert(local_predictor_idx < localPredictorSize); - // Increment or decrement twice to undo speculative update, then - // properly update if (taken) { DPRINTF(Fetch, "Branch predictor: Branch updated as taken.\n"); localCtrs[local_predictor_idx].increment(); -// localCtrs[local_predictor_idx].increment(); } else { DPRINTF(Fetch, "Branch predictor: Branch updated as not taken.\n"); localCtrs[local_predictor_idx].decrement(); -// localCtrs[local_predictor_idx].decrement(); } } + +inline +bool +DefaultBP::getPrediction(uint8_t &count) +{ + // Get the MSB of the count + return (count >> (localCtrBits - 1)); +} + +inline +unsigned +DefaultBP::getLocalIndex(Addr &branch_addr) +{ + return (branch_addr >> instShiftAmt) & indexMask; +} |