history->localPredTaken = local_prediction;
history->globalPredTaken = global_prediction;
history->globalUsed = choice_prediction;
+ history->localHistoryIdx = local_history_idx;
history->localHistory = local_predictor_idx;
bp_history = (void *)history;
history->localPredTaken = true;
history->globalPredTaken = true;
history->globalUsed = true;
+ history->localHistoryIdx = invalidPredictorIndex;
history->localHistory = invalidPredictorIndex;
bp_history = static_cast<void *>(history);
// Restore global history to state prior to this branch.
globalHistory = history->globalHistory;
+ // Restore local history
+ if (history->localHistoryIdx != invalidPredictorIndex) {
+ localHistoryTable[history->localHistoryIdx] = history->localHistory;
+ }
+
// Delete this BPHistory now that we're done with it.
delete history;
}