【正文】
nd Culler 169。 Man Kaufmann ECE668 .17 Adapted from Patterson, Katz and Culler 169。 00,10,11 00,11 10 Use 1 Use 2 Use 2 Use 1 00,01,11 00,11 10 10 01 01 01 4K ? 2 bits 1 3 2 12 . . . Copyright 2020 UCB amp。 Man Kaufmann ECE668 .15 Adapted from Patterson, Katz and Culler 169。 UCB Gselect and Gshare predictors ? Keep a global register (GR) with oute of k branches ? Use that in conjunction with PC to index into a table containing 2bit predictor ? Gselect – concatenate ? Gshare – XOR (better) Copyright 2020 CAM / P HTg l o b a l b r a n c h h i s t o r yr e g i s t e r ( G B H R )/d e c o d e2p r e d i c t :t a k e n /n o t t a k e nshiftb r a n c h r e s u l t :t a k e n /n o t t a k e n Copyright 2020 UCB amp。 UCB Accuracy of Different Schemes Copyright 2020 UCB amp。 UCB Further Comparison ?Alternating taken / nottaken ?Your worstcase prediction scenario ?Both schemes achieve 8095% accuracy with only a small difference in behavior T T N T N T N N T* T*N N* N*T T T N T N T N N T* T*N N* N*T 1 2 Copyright 2020 UCB amp。 A. Smith, IEEE Computer, Jan 1984 Copyright 2020 UCB amp。 Man Kaufmann ECE668 .6 Adapted from Patterson, Katz and Culler 169。 Man Kaufmann ECE668 .4 Adapted from Patterson, Katz and Culler 169。 Man Kaufmann ECE668 .2 Adapted from Patterson, Katz and Culler 169。 Copyright 2020 UCB amp。 Computer Engineering Computer Architecture ECE 668 Dynamic Branch Prediction Copyright 2020 UCB amp。 UCB Eight Branch Prediction Schemes ? 1bit BranchPrediction ? 2bit BranchPrediction ? Correlating Branch Prediction ? Gshare ? Tournament Branch Predictor ? Branch Target Buffer ? Conditionally Executed Instructions ? Return Address Predictors Branch Prediction even more important when N instructions per cycle are issued Amdahl’s Law = relative impact of the control stalls will be larger with the lower potential CPI in an nissue processor Copyright 2020 UCB amp。 UCB ?Better Solution: 2bit scheme: ?Red: stop, not taken ?Green: go, taken 2bit Branch Prediction Scheme 1 T T N Predict Taken Predict Not Taken Predict Taken Predict Not Taken T N T N N T* T*N N* N*T (Jim Smith, 1981) Copyright 2020 UCB amp。 UCB ?Another Solution: 2bit scheme where change prediction (in either direction) only if get misprediction twice: ?Red: stop, not taken ?Green: go, taken 2bit Branch Prediction Scheme 2 T T N Predict Taken Predict Not Taken Predict Taken Predict Not Taken T N T N N T* T*N N* N*T Lee amp。 Man Kaufmann ECE668 .9 Adapted from Patterson, Katz and Culler 169。 Man Kaufmann ECE668 .11 Adapted from Patt