Download presentation
Presentation is loading. Please wait.
1
Gang Luo, Hongfei Guo {gangluo, guo}@cs.wisc.edu
Software-based and Hardware-based Branch Prediction Strategies and Performance Evaluation Gang Luo, Hongfei Guo {gangluo,
2
Contents Background Implementation based on SimpleScalar3.0
Simulation Model Simulation Results Conclusion and Future work
3
1. Background Why branch prediction? Software-based branch predictors
Hardware-based branch predictors
4
Why need branch prediction
Avoid control hazard Predict branch direction and branch address Avoid stopping pipeline Speedup program execution
5
Classification of Branch Prediction Strategies
Software-based static branch predictors Hardware-based dynamic branch predictors
6
Software-based Strategy
Always Taken Always Not Taken Backward Taken, Forward Not Taken All branches with certain operation codes Taken, others Not Taken
7
Hardware-based Strategy
One-bit counter Two-bit counter Gag Pag Pap Branch Instruction Table
8
2. Implementation based on SS3.0
Backward taken & forward not taken one-bit prediction counter fix a bug ---- Support command line configuration
9
current branch address Backward taken & forward not taken
Y target address Current address > Target address Predicted address Next inst. address target address N Backward taken & forward not taken branch predictor
10
current branch address Predicted inst. address
One bit counter (two bits counter) HASH table current branch address HASH 1 …… Lookup Predicted direction BTB update address2 target address2 Addressn-1 target address n-1 address1 target address1 …… address n target address n Predicted target 2 to 1 MUX Predicted inst. address Next inst. address Compare update New inst. address Branch prediction counter
11
3. Simulation Model Mode Level 1 Table Level 2 Table
# of Entries Width of SR # of Entries One-bit Bimode GAg PAg PAp BTB Associ
12
Spec95 Benchmarks Used Gcc Compress Li M88k Perl
13
4. Simulation Results Results of software-based Strategies
Results of hardware-based Strategies Software-based Strategies vs. hardware-based Strategies Explanations
14
Performance of Software-based Strategies
15
Analysis of Software-based Strategies
Always Taken is the best one Always Not Taken & Backward Taken, Forward Not Taken are equally bad
16
Explanation Backward Taken, Forward Not Taken is mainly pointed at the for loop and while loop statement Most branches in the program are inclined to be taken
17
Performance of Hardware-based Strategies
18
Analysis of Hardware-based Strategies
Two-bit counter and Gag are the best two One-bit counter, Pag, and Pap also achieve high prediction accuracy
19
Explanation One-bit counter: intrinsic shortcoming
Pag: all the branch histories share the same global two-bit counter tables, which leads to confusion Pap: too many branch history pattern tables compared to the number of instructions executed, can’t get enough training
20
Software-based Strategies vs. Hardware-based Strategies
Hardware-based strategies always achieve high prediction accuracy, greater than 90% Most software-based strategies achieve low prediction accuracy, less than 70%
21
Explanation Different data sets will let the programs have different dynamic branch behaviors Even for the same data set, the same branch instruction will exhibit different dynamic branch behaviors at different times in the same running
22
5. Future Work Use some AI algorithms to adjust the parameters of the branch prediction strategies, then we can ensure the most proper training time to achieve the highest performance.
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.