【正文】
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。 each entry in the global predictor is a standard 2bit predictor ? 12bit pattern: ith bit is 0 = ith prior branch not taken。 Man Kaufmann ECE668 .15 Adapted from Patterson, Katz and Culler 169。 UCB Tournament Predictors ?Motivation for correlating branch predictors: 2bit local predictor failed on important branches。 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 Reevaluating Correlation ? Several SPEC benchmarks have less than a dozen branches responsible for 90% of taken branches: program branch % static = 90% press 14% 236 13 eqntott 25% 494 5 gcc 15% 9531 2020 mpeg 10% 5598 532 real gcc 13% 17361 3214 ? Real programs + OS more like gcc ? Small benefits of correlation beyond benchmarks? ? Mispredict because either: ? Wrong guess for that branch ? Got branch history of wrong branch when indexing the table ? For SPEC92, 4096 about as good as infinite table ? Misprediction mostly due to wrong prediction ? Can we improve using global history? Copyright 2020 UCB amp。 UCB Accuracy of Different Schemes Copyright 2020 UCB amp。 UCB Correlating Branches Idea: taken/not taken of recently executed branches is related to behavior of present branch (as well as the history of that branch behavior) ? Then behavior of recent branches selects between, say, 4 predictions of next branch, updating just that prediction ?(2,2) predictor: 2bit global, 2bit local Branch address (4 bits) 2bits per branch local predictors Prediction 2bit recent global branch history (01 = not taken (0) then taken (1) branches before reaching this) 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。 UCB Comparison Actual: N N T N N T N N State: N* N* N* N*T N* N* N*T N* Predicted: N N N N N N N N Actual: T N T T T N T State: T* T* T*N T* T* T* T*N T* Predicted: T T T T T T T Actual: N N T T N N T T State: N* N* N* N*T T* T*N N* N*T Predicted: N N N N ?