45namespace branch_prediction
49 const MPP_StatisticalCorrector_64KBParams &
p)
51 numEntriesSecondLocalHistories(
p.numEntriesSecondLocalHistories),
52 numEntriesThirdLocalHistories(
p.numEntriesThirdLocalHistories),
69 sh->setNumOrdinalHistories(3);
93 unsigned int pc = branch_pc;
94 lsum +=
gPredict((
pc << 1) +
bi->predBeforeSC,
sh->globalHist << 11,
98 lsum += 2.02 *
gPredict(branch_pc,
sh->getLocalHistory(1, branch_pc),
100 if (
sh->getLocalHistory(1, branch_pc) == 2047) lsum += 4;
101 if (
sh->getLocalHistory(1, branch_pc) == 0) lsum -= 4;
104 lsum +=
gPredict(branch_pc,
sh->getLocalHistory(3, branch_pc) << 11,
108 lsum +=
gPredict(branch_pc,
sh->getLocalHistory(2, branch_pc),
111 lsum +=
gPredict(branch_pc,
sh->getHistoryStackEntry(),
125 gUpdate((
pc << 1) +
bi->predBeforeSC, taken,
sh->globalHist << 11,
155 sh->updateLocalHistory(2, branch_pc, taken,
156 (branch_pc ^ (branch_pc >> 4)) & 15);
157 sh->updateLocalHistory(3, branch_pc, taken);
159 sh->updateHistoryStack(corrTarget, taken, inst->
isCall(),
206 const MultiperspectivePerceptronTAGE64KBParams &
p)
bool isDirectCtrl() const
bool isUncondCtrl() const
size_t getSizeInBits() const override
const unsigned numEntriesSecondLocalHistories
void getBiasLSUM(Addr branch_pc, StatisticalCorrector::BranchInfo *bi, int &lsum) const override
StatisticalCorrector::SCThreadHistory * makeThreadHistory() override
void gUpdates(ThreadID tid, Addr pc, bool taken, StatisticalCorrector::BranchInfo *bi, int64_t phist) override
std::vector< int8_t > * sgehl
const unsigned numEntriesThirdLocalHistories
MPP_StatisticalCorrector_64KB(const MPP_StatisticalCorrector_64KBParams &p)
std::vector< int8_t > * tgehl
void scHistoryUpdate(Addr branch_pc, const StaticInstPtr &inst, bool taken, StatisticalCorrector::BranchInfo *bi, Addr corrTarget) override
int gPredictions(ThreadID tid, Addr branch_pc, StatisticalCorrector::BranchInfo *bi, int &lsum, int64_t phist) override
unsigned getIndUpd(Addr branch_pc) const override
void gUpdate(Addr branch_pc, bool taken, int64_t hist, std::vector< int > &length, std::vector< int8_t > *tab, int nbr, int logs, std::vector< int8_t > &w, StatisticalCorrector::BranchInfo *bi) override
unsigned getIndBiasSK(Addr branch_pc, StatisticalCorrector::BranchInfo *bi) const override
unsigned getIndBias(Addr branch_pc, StatisticalCorrector::BranchInfo *bi, bool bias) const override
std::vector< int8_t > * pgehl
std::vector< int8_t > * ggehl
MultiperspectivePerceptronTAGE64KB(const MultiperspectivePerceptronTAGE64KBParams &p)
void createSpecs() override
Creates the tables of the predictor.
void addSpec(HistorySpec *spec)
Add a table spec to the prefetcher.
void initGEHLTable(unsigned numLenghts, std::vector< int > lengths, std::vector< int8_t > *&table, unsigned logNumEntries, std::vector< int8_t > &w, int8_t wInitValue)
std::vector< int8_t > * lgehl
virtual void scHistoryUpdate(Addr branch_pc, const StaticInstPtr &inst, bool taken, BranchInfo *tage_bi, Addr corrTarget)
int gPredict(Addr branch_pc, int64_t hist, std::vector< int > &length, std::vector< int8_t > *tab, int nbr, int logs, std::vector< int8_t > &w)
const unsigned scCountersWidth
const unsigned numEntriesFirstLocalHistories
SCThreadHistory * scHistory
const unsigned chooserConfWidth
std::vector< int8_t > biasSK
std::vector< int > pUpdateThreshold
std::vector< int8_t > bias
const unsigned pUpdateThresholdWidth
constexpr T bits(T val, unsigned first, unsigned last)
Extract the bitfield from position 'first' to 'last' (inclusive) from 'val' and right justify it.
Copyright (c) 2024 - Pranith Kumar Copyright (c) 2020 Inria All rights reserved.
int16_t ThreadID
Thread index/ID type.
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.