







Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!








Based on Material provided by Prof. Al Davis and Prof. David Culler
K-bits
Past a good a good indicator of the future
1 = Taken 0= Not Taken
You make a mistake^ Update BHT when What are the problems? a) Aliasing due to limited size of the BHT (tag can be stored to b) avoid this problem)1-bit history may not be sufficient? Eg: consider a loop that iterates 10 times – You will mispredict 2/10 so accuracy is 80%
Predict Taken Predict Not Taken
Predict Taken Predict Not Taken
PC K-bits
Consider the simple for loop FOR (I=1; I<5; I++) { something …} If the branch is at the end of the loop body, it has following pattern – (1110)N The sequence of the branch history is 11101110111011101110 …… Basically, if we know what the branch did the last three times, we can predict EXACTLY what it will do next.
PC k
LHT/PHT 1-bit or 2-bit or m-bit counter
Counter
3-bit local history
(^3) accuracy97.1% accesses^ 2-mem
Frequency of
Mispredictions
compress eqntott 14%25% (^236494 ) gcc mpeg 15%10% (^95315598 ) real gcc 13% 17361 3214
fig 3.
L2: Add r1,r2, r
Initial HW Model here; MIPS compilers. Assumptions for ideal/perfect machine to start: 1. Register renaming – infinite virtual registers => all register WAW & WAR hazards are avoided 2. Branch prediction – perfect; no mispredictions
Also:^ equal unlimited number of instructions issued/clock cycle; perfect caches; 1 cycle latency for all instructions (FP *,/);
IPC
Perfect Tournament BHT (512) Profile No prediction
IPC
IPC
SPEC 2000 Performance 3/2001 Source: Microprocessor Report, www.MPRonline.com