From 34065f8d5f51e165b56d12a6d88092332809f0b9 Mon Sep 17 00:00:00 2001 From: Arthur Perais Date: Wed, 21 Dec 2016 15:06:13 -0600 Subject: [PATCH] cpu: correct comments in tournament branch predictor The tournament predictor is presented as doing speculative update of the global history and non-speculative update of the local history used to generate the branch prediction. However, the code does speculative update of both histories. Signed-off-by: Jason Lowe-Power --- src/cpu/pred/tournament.cc | 4 ++-- src/cpu/pred/tournament.hh | 5 ++--- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/src/cpu/pred/tournament.cc b/src/cpu/pred/tournament.cc index 319606871..96f03eb30 100644 --- a/src/cpu/pred/tournament.cc +++ b/src/cpu/pred/tournament.cc @@ -222,8 +222,8 @@ TournamentBP::lookup(ThreadID tid, Addr branch_addr, void * &bp_history) assert(local_history_idx < localHistoryTableSize); - // Commented code is for doing speculative update of counters and - // all histories. + // Speculative update of the global history and the + // selected local history. if (choice_prediction) { if (global_prediction) { updateGlobalHistTaken(tid); diff --git a/src/cpu/pred/tournament.hh b/src/cpu/pred/tournament.hh index 3aa17e030..0febd21bc 100644 --- a/src/cpu/pred/tournament.hh +++ b/src/cpu/pred/tournament.hh @@ -57,9 +57,8 @@ * used in the 21264. It has a local predictor, which uses a local history * table to index into a table of counters, and a global predictor, which * uses a global history to index into a table of counters. A choice - * predictor chooses between the two. Only the global history register - * is speculatively updated, the rest are updated upon branches committing - * or misspeculating. + * predictor chooses between the two. Both the global history register + * and the selected local history are speculatively updated. */ class TournamentBP : public BPredUnit { -- 2.30.2