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.21 A schematic for a GAs global-history predictor. N global history bits are concatenated with M bits<br />

from the branch address to form the PHT index.<br />

refers to a predictor that explicitly allocates groups of branches to particular BHT entries, and is only feasible<br />

with extensive profiling or compiler support and hence has received little study. Skadron, Martonosi, and<br />

Clark [37] added a fourth type, M, to this naming scheme to describe predictors that track a combination<br />

of global and local history. The second letter, A or S, indicates whether the PHT is adaptive, using a finite<br />

state machine based on saturating counters, or fixed, using statically assigned directions (a profiling pass<br />

might determine the best PHT value for each entry); almost all predictors proposed or under study,<br />

however, are A—adaptive. The third letter, g, s, or p, indicates the PHT organization. The PHT might<br />

be indexed purely by history (g); or indexed using some concatenated branch address bits, making it setassociative<br />

(s); or the predictor might have a separate PHT for each branch (p, for per-branch). This last<br />

choice eliminates aliasing among branches but is prohibitively large for all but small history sizes, and<br />

is therefore mainly of theoretical interest. A pure global-history predictor like that in Fig. 6.20 is, therefore,<br />

a GAg predictor and a pure local-history predictor like that in Fig. 6.19 is a PAg predictor. If either of<br />

these concatenate some address bits into the index, like the global-history predictor in Fig. 6.21, they<br />

become GAs or PAs predictors. Note that the GAs predictor has also sometimes been referred to as gselect<br />

[40]. Finally, a predictor that uses both global and per-branch history, such as the bi-mode predictor,<br />

would be an MAg or MAs predictor [37]. As for specifying the specific configuration of a predictor—how<br />

many bits, how many entries, etc.—so many notations are involved that it is better to just be explicit.<br />

An alternative anti-aliasing approach is to XOR the history string and address string together; this<br />

approach, introduced by McFarling [40], is called gshare. This avoids the need to use a shorter history<br />

string—both strings can be as long as the index. Recent data by Sechrest, Lee, and Mudge [41], however,<br />

suggest that gshare confers little benefit over GAs.<br />

Two-level prediction can seem like magic, especially global-history prediction. But it operates on the<br />

same principle as compression; a predictable sequence is also compressible. Indeed, two-level prediction<br />

is a simplified version of a Markov model, the same principle that underlies the prediction by partial<br />

matching (PPM) compression scheme [42].<br />

Hybrid Prediction<br />

Because some branches do benefit from global history and others do not, McFarling [40] proposed hybrid<br />

branch prediction. Several different organizations have been proposed [43–45], but the common idea is<br />

to operate two different predictors in parallel, and for each branch select which predictor’s output to<br />

actually use in making the prediction. The selector is itself a predictor and can be any of the structures<br />

described above, but the selector tracks predictor successes rather than branch outcomes. For each branch,<br />

the selector attempts to learn which predictor component is more effective. Figure 6.22 shows a highlevel<br />

schematic of a hybrid predictor’s organization. Note that both predictor components and the selector<br />

can all be accessed in parallel to minimize lookup time.<br />

The Compaq Alpha 21264 [25] uses a hybrid predictor comprised of 12-bit GAg and 10-bit PAg<br />

predictors. The PAg component has a 1 K-entry BHT and, because it uses only history bits in indexing<br />

© 2002 by CRC Press LLC<br />

GBHR<br />

baddr<br />

N<br />

M<br />

PHT<br />

T/NT

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

Saved successfully!

Ooh no, something went wrong!