diff options
Diffstat (limited to 'src/cpu/pred/btb.cc')
-rw-r--r-- | src/cpu/pred/btb.cc | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/src/cpu/pred/btb.cc b/src/cpu/pred/btb.cc index c7ef1959f..393e52ccf 100644 --- a/src/cpu/pred/btb.cc +++ b/src/cpu/pred/btb.cc @@ -35,12 +35,10 @@ DefaultBTB::DefaultBTB(unsigned _numEntries, unsigned _tagBits, - unsigned _instShiftAmt, - unsigned _num_threads) + unsigned _instShiftAmt) : numEntries(_numEntries), tagBits(_tagBits), - instShiftAmt(_instShiftAmt), - log2NumThreads(floorLog2(_num_threads)) + instShiftAmt(_instShiftAmt) { DPRINTF(Fetch, "BTB: Creating BTB object.\n"); @@ -71,12 +69,10 @@ DefaultBTB::reset() inline unsigned -DefaultBTB::getIndex(Addr instPC, ThreadID tid) +DefaultBTB::getIndex(Addr instPC) { // Need to shift PC over by the word offset. - return ((instPC >> instShiftAmt) - ^ (tid << (tagShiftAmt - instShiftAmt - log2NumThreads))) - & idxMask; + return (instPC >> instShiftAmt) & idxMask; } inline @@ -89,7 +85,7 @@ DefaultBTB::getTag(Addr instPC) bool DefaultBTB::valid(Addr instPC, ThreadID tid) { - unsigned btb_idx = getIndex(instPC, tid); + unsigned btb_idx = getIndex(instPC); Addr inst_tag = getTag(instPC); @@ -110,7 +106,7 @@ DefaultBTB::valid(Addr instPC, ThreadID tid) TheISA::PCState DefaultBTB::lookup(Addr instPC, ThreadID tid) { - unsigned btb_idx = getIndex(instPC, tid); + unsigned btb_idx = getIndex(instPC); Addr inst_tag = getTag(instPC); @@ -128,7 +124,7 @@ DefaultBTB::lookup(Addr instPC, ThreadID tid) void DefaultBTB::update(Addr instPC, const TheISA::PCState &target, ThreadID tid) { - unsigned btb_idx = getIndex(instPC, tid); + unsigned btb_idx = getIndex(instPC); assert(btb_idx < numEntries); |