2bit_local.cc (11429:cf5af0cc3be4) 2bit_local.cc (11434:b5aed9d2d54e)
1/*
2 * Copyright (c) 2004-2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 64 unchanged lines hidden (view full) ---

73LocalBP::reset()
74{
75 for (unsigned i = 0; i < localPredictorSets; ++i) {
76 localCtrs[i].reset();
77 }
78}
79
80void
1/*
2 * Copyright (c) 2004-2006 The Regents of The University of Michigan
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions are
7 * met: redistributions of source code must retain the above copyright
8 * notice, this list of conditions and the following disclaimer;

--- 64 unchanged lines hidden (view full) ---

73LocalBP::reset()
74{
75 for (unsigned i = 0; i < localPredictorSets; ++i) {
76 localCtrs[i].reset();
77 }
78}
79
80void
81LocalBP::btbUpdate(Addr branch_addr, void * &bp_history)
81LocalBP::btbUpdate(ThreadID tid, Addr branch_addr, void * &bp_history)
82{
83// Place holder for a function that is called to update predictor history when
84// a BTB entry is invalid or not found.
85}
86
87
88bool
82{
83// Place holder for a function that is called to update predictor history when
84// a BTB entry is invalid or not found.
85}
86
87
88bool
89LocalBP::lookup(Addr branch_addr, void * &bp_history)
89LocalBP::lookup(ThreadID tid, Addr branch_addr, void * &bp_history)
90{
91 bool taken;
92 uint8_t counter_val;
93 unsigned local_predictor_idx = getLocalIndex(branch_addr);
94
95 DPRINTF(Fetch, "Looking up index %#x\n",
96 local_predictor_idx);
97

--- 14 unchanged lines hidden (view full) ---

112 localCtrs[local_predictor_idx].decrement();
113 }
114#endif
115
116 return taken;
117}
118
119void
90{
91 bool taken;
92 uint8_t counter_val;
93 unsigned local_predictor_idx = getLocalIndex(branch_addr);
94
95 DPRINTF(Fetch, "Looking up index %#x\n",
96 local_predictor_idx);
97

--- 14 unchanged lines hidden (view full) ---

112 localCtrs[local_predictor_idx].decrement();
113 }
114#endif
115
116 return taken;
117}
118
119void
120LocalBP::update(Addr branch_addr, bool taken, void *bp_history, bool squashed)
120LocalBP::update(ThreadID tid, Addr branch_addr, bool taken, void *bp_history,
121 bool squashed)
121{
122 assert(bp_history == NULL);
123 unsigned local_predictor_idx;
124
125 // Update the local predictor.
126 local_predictor_idx = getLocalIndex(branch_addr);
127
128 DPRINTF(Fetch, "Looking up index %#x\n", local_predictor_idx);

--- 18 unchanged lines hidden (view full) ---

147inline
148unsigned
149LocalBP::getLocalIndex(Addr &branch_addr)
150{
151 return (branch_addr >> instShiftAmt) & indexMask;
152}
153
154void
122{
123 assert(bp_history == NULL);
124 unsigned local_predictor_idx;
125
126 // Update the local predictor.
127 local_predictor_idx = getLocalIndex(branch_addr);
128
129 DPRINTF(Fetch, "Looking up index %#x\n", local_predictor_idx);

--- 18 unchanged lines hidden (view full) ---

148inline
149unsigned
150LocalBP::getLocalIndex(Addr &branch_addr)
151{
152 return (branch_addr >> instShiftAmt) & indexMask;
153}
154
155void
155LocalBP::uncondBranch(Addr pc, void *&bp_history)
156LocalBP::uncondBranch(ThreadID tid, Addr pc, void *&bp_history)
156{
157}
158
159LocalBP*
160LocalBPParams::create()
161{
162 return new LocalBP(this);
163}
157{
158}
159
160LocalBP*
161LocalBPParams::create()
162{
163 return new LocalBP(this);
164}