Hardware Reference
In-Depth Information
a table of 1K entries consisting of 3-bit saturating counters, which provide the local prediction.
This combination, which uses a total of 29K bits, leads to high accuracy in branch prediction.
The Intel Core I7 Branch Predictor
Intel has released only limited amounts of information about the Core i7's branch predictor,
which is based on earlier predictors used in the Core Duo chip. The i7 uses a two-level predict-
or that has a smaller first-level predictor, designed to meet the cycle constraints of predicting a
branch every clock cycle, and a larger second-level predictor as a backup. Each predictor com-
bines three different predictors: (1) the simple two-bit predictor, which was introduced in Ap-
pendix C (and used in the tournament predictor discussed above); (2) a global history predict-
or, like those we just saw; and (3) a loop exit predictor. The loop exit predictor uses a counter
to predict the exact number of taken branches (which is the number of loop iterations) for a
branch that is detected as a loop branch. For each branch, the best prediction is chosen from
among the three predictors by tracking the accuracy of each prediction, like a tournament pre-
dictor. In addition to this multilevel main predictor, a separate unit predicts target addresses
for indirect branches, and a stack to predict return addresses is also used.
As in other cases, speculation causes some challenges in evaluating the predictor, since a
mispredicted branch may easily lead to another branch being fetched and mispredicted. To
keep things simple, we look at the number of mispredictions as a percentage of the number
of successfully completed branches (those that were not the result of misspeculation). Figure
3.5 shows these data for 19 of the SPECCPU 2006 benchmarks. These benchmarks are consid-
erably larger than SPEC89 or SPEC2000, with the result being that the misprediction rates are
slightly higher than those in Figure 3.4 even with a more elaborate combination of predict-
ors. Because branch misprediction leads to ineffective speculation, it contributes to the wasted
work, as we will see later in this chapter.
Search WWH ::




Custom Search