ltage.cc (13454:19a5b4fb1f1f) ltage.cc (13455:56e25a5f9603)
1/*
2 * Copyright (c) 2014 The University of Wisconsin
3 *
4 * Copyright (c) 2006 INRIA (Institut National de Recherche en
5 * Informatique et en Automatique / French National Research Institute
6 * for Computer Science and Applied Mathematics)
7 *
8 * All rights reserved.

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

223
224 bool pred_taken = tagePredict(tid, branch_pc, cond_branch, bi);
225
226 if (cond_branch) {
227 bi->loopPred = getLoop(branch_pc, bi); // loop prediction
228
229 if ((loopUseCounter >= 0) && bi->loopPredValid) {
230 pred_taken = bi->loopPred;
1/*
2 * Copyright (c) 2014 The University of Wisconsin
3 *
4 * Copyright (c) 2006 INRIA (Institut National de Recherche en
5 * Informatique et en Automatique / French National Research Institute
6 * for Computer Science and Applied Mathematics)
7 *
8 * All rights reserved.

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

223
224 bool pred_taken = tagePredict(tid, branch_pc, cond_branch, bi);
225
226 if (cond_branch) {
227 bi->loopPred = getLoop(branch_pc, bi); // loop prediction
228
229 if ((loopUseCounter >= 0) && bi->loopPredValid) {
230 pred_taken = bi->loopPred;
231 bi->provider = LOOP;
231 }
232 DPRINTF(LTage, "Predict for %lx: taken?:%d, loopTaken?:%d, "
233 "loopValid?:%d, loopUseCounter:%d, tagePred:%d, altPred:%d\n",
234 branch_pc, pred_taken, bi->loopPred, bi->loopPredValid,
235 loopUseCounter, bi->tagePred, bi->altTaken);
236 }
237
238 specLoopUpdate(branch_pc, pred_taken, bi);

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

283 int idx = bi->loopIndex + bi->loopHit;
284 ltable[idx].currentIterSpec = bi->currentIter;
285 }
286 }
287
288 TAGE::squash(tid, bp_history);
289}
290
232 }
233 DPRINTF(LTage, "Predict for %lx: taken?:%d, loopTaken?:%d, "
234 "loopValid?:%d, loopUseCounter:%d, tagePred:%d, altPred:%d\n",
235 branch_pc, pred_taken, bi->loopPred, bi->loopPredValid,
236 loopUseCounter, bi->tagePred, bi->altTaken);
237 }
238
239 specLoopUpdate(branch_pc, pred_taken, bi);

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

284 int idx = bi->loopIndex + bi->loopHit;
285 ltable[idx].currentIterSpec = bi->currentIter;
286 }
287 }
288
289 TAGE::squash(tid, bp_history);
290}
291
292
293void
294LTAGE::updateStats(bool taken, TageBranchInfo* bi)
295{
296 TAGE::updateStats(taken, bi);
297
298 LTageBranchInfo * ltage_bi = static_cast<LTageBranchInfo *>(bi);
299
300 if (ltage_bi->provider == LOOP) {
301 if (taken == ltage_bi->loopPred) {
302 loopPredictorCorrect++;
303 } else {
304 loopPredictorWrong++;
305 }
306 }
307}
308
309
310
311void
312LTAGE::regStats()
313{
314 TAGE::regStats();
315
316 loopPredictorCorrect
317 .name(name() + ".loopPredictorCorrect")
318 .desc("Number of times the loop predictor is the provider and "
319 "the prediction is correct");
320
321 loopPredictorWrong
322 .name(name() + ".loopPredictorWrong")
323 .desc("Number of times the loop predictor is the provier and "
324 "the prediction is wrong");
325}
326
327
328
291LTAGE*
292LTAGEParams::create()
293{
294 return new LTAGE(this);
295}
329LTAGE*
330LTAGEParams::create()
331{
332 return new LTAGE(this);
333}