【正文】
2 1 Copyright 2020 UCB amp。 Man Kaufmann ECE668 .5 Adapted from Patterson, Katz and Culler 169。 UCB Csaba Andras Moritz UNIVERSITY OF MASSACHUSETTS Dept. of Electrical amp。 UCB Static Branch Prediction ?Simplest: Predict taken ? average misprediction rate = untaken branch frequency, which for the SPEC programs is 34% ? Unfortunately, the correct prediction rate ranges from not very accurate (41%) to highly accurate (91%) ?Predict on the basis of branch direction? ? choosing backwardgoing branches to be taken (loop) ? forwardgoing branches to be not taken (if) ? SPEC programs, however, most forwardgoing branches are taken = predict taken is better ?Predict branches on the basis of profile information collected from earlier runs ? Misprediction varies from 5% to 22% Copyright 2020 UCB amp。 UCB Branch History Table (BHT) ?BHT is a table of “Predictors” ? 2bit, saturating counters indexed by PC address of Branch ?In Fetch phase of branch: ? Predictor from BHT used to make prediction ?When branch pletes: ? Update corresponding Predictor Predictor 0 Predictor 127 Predictor 1 ? ? ? Branch PC T T N T N T N N T* T*N N* N*T Copyright 2020 UCB amp。 Man Kaufmann ECE668 .10 Adapted from Patterson, Katz and Culler 169。 Man Kaufmann ECE668 .14 Adapted from Patterson, Katz and Culler 169。 Man Kaufmann ECE668 .16 Adapted from Patterson, Katz and Culler 169。 UCB Accuracy v. Size (SPEC89) 0% 1% 2% 3% 4% 5% 6% 7% 8% 9% 10% 0 8 16 24 32 40 48 56 64 72 80 88 96 104 112 120 128 Total predictor size (Kbits) Conditional branch misprediction rate Local 2 bit counters Correlating (2,2) scheme Tournament Copyright 2020 UCB amp。 Man Kaufmann ECE668 .22 Adapted from Patterson, Katz and Culler 169。 Man Kaufmann ECE668 .24 Adapted from Patterson, Katz and Culler 169。 Compiletime Copyright 2020 CAM amp。 Man Kaufmann ECE668 .28 Adapted from Patterson, Katz and Culler 169。 BlueRISC Copyright 2020 UCB amp。 Use static information 187。 continue execution with no stalls No Yes Yes Yes No No ID IF EX for the 5stage MIPS Copyright 2020 UCB amp。 proceed normally (PC+4) Copyright 2020 UCB amp。 UCB % of predictions from local predictor in Tournament Prediction Scheme 98% 100% 94% 90% 55% 76% 72% 63% 37% 69% 0% 20% 40% 60% 80% 100% nasa7 matrix300 tomcatv doduc spice fpppp gcc espresso eqntott li Copyright 2020 UCB amp。 UCB Tournament Predictor in Alpha 21264 ? 4K 2bit counters to choose from among a global predictor and a local predictor ? Global predictor also has 4K entries and is indexed by the history of the last 12 branches。 Man Kaufmann ECE668 .12 Adapted from Patterson, Katz and Culler 169。 Man Kaufmann ECE668 .8 Adapted from P