15.01.2013 Views

U. Glaeser

U. Glaeser

U. Glaeser

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

FIGURE 6.20 A schematic for a GAg global-history predictor. The global history of recent branch outcomes,<br />

contained in the global branch history register (GBHR) is used to index the PHT.<br />

prediction is extremely effective. The reason is that global history exposes correlation among branches<br />

(and hence these predictors are also called correlating predictors). Consider the following sequence of<br />

code.<br />

Even if B1 and B2 are entirely unpredictable because x and y have very random behavior, B3 can be<br />

predicted with 100% accuracy if the outcomes of B1 and B2 are known, because the outcome of B3 is<br />

entirely correlated with the outcomes of B1 and B2. Global history is an admittedly crude way to expose<br />

this sort of correlation, because the GBHR also contains outcomes from other branches that provide no<br />

useful information. Yet as the section on “Comparison of Hardware Prediction Strategies” shows, global<br />

history is quite effective, and Evers et al. [34] have shown that many programs contain substantial degrees<br />

of correlated branch behavior. Unfortunately, no one has come up with a practical hardware technique<br />

for exposing correlation while avoiding the noise that unrelated branches introduce into the GBHR.<br />

Both the local-history and global-history predictors described above have the problem that different<br />

branches may see the same prior history. All branches that see the same history will map to the same<br />

PHT entry. Especially with global prediction, equivalent history does not always mean the branches will<br />

behave the same way. To reduce the consequent destructive PHT conflicts, Pan, So, and Rahmeh [35]<br />

point out that bits from the branch address can be combined with the history bits in order to provide<br />

some degree of anti-aliasing—see Fig. 6.21, for example. The simplest technique is to concatenate the two<br />

bit sources. For N bits of history and M bits of branch address, this creates a configuration where each<br />

M-bit address pattern has its own 2 N -entry PHT.<br />

For a fixed table size and hence a fixed number of bits in the index, this necessitates a reduction in<br />

the number of history bits, so a balance must be found between the added prediction capability provided<br />

by history bits and the anti-aliasing capability provided by address bits. This balance is sensitive to the<br />

table size. In a study of the SPECint95 benchmarks [36], Skadron, Martonosi, and Clark [37] find that<br />

as a general rule of thumb, both global- and local-history predictors should use at least 6–7 bits of branch<br />

address, regardless of predictor size. Predictors with more aggressive anti-aliasing techniques, e.g., the<br />

bi-mode predictor of Lee, Chen, and Mudge [38], will need fewer address bits.<br />

To classify the different possible two-level predictor organizations, Yeh and Patt [33,39] developed a<br />

naming scheme that uses three letters to characterize the different organizational choices. The first letter,<br />

G, P, or S, indicates the type of history, global, per branch (i.e., local), or per branch set. The last choice<br />

© 2002 by CRC Press LLC<br />

GBHR<br />

PHT<br />

B1: if (x)<br />

…<br />

B2: if (y)<br />

…<br />

z = x && y;<br />

B3: if (z)<br />

…<br />

T/NT

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!