












Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
This presentation covers the fundamentals of branch prediction, a CPU optimization technique used to guess the outcome of conditional operations and prepare for the most likely result. three types of branches - forward, backward, and unconditional - and two prediction methods: static and dynamic. Static prediction schemes, such as forward and backward conditional branches, use a static predictor that looks for the offset of the conditional branch and predicts based on that. Dynamic prediction schemes, like the Branch History Table (BHT) and Two-Level Adaptive Branch Predictor, utilize hardware-based mechanisms to make more accurate predictions based on the run-time behavior of branches.
Typology: Slides
1 / 20
This page cannot be seen from the preview
Don't miss anything!













th
th
4
“
5
Static Branch Prediction ⊳ (^) Static Branch Prediction predicts always the same direction for the same branch during the whole program execution. ⊳ (^) It comprises hardware- fixed prediction and Dynamic Branch Prediction ⊳ (^) Dynamic Branch Prediction: the hardware influences the prediction while execution proceeds. ⊳ (^) Prediction is decided on the computation history of the program. 7
Forward Conditional Branches ⊳ (^) based on a run-time condition, the PC (Program Counter) is changed to point to an address forward in the instruction stream. ⊳ (^) A static predictor looks for the offset of the conditional branch and predicts to take Backward Conditional Branches ⊳ (^) based on a run-time condition, the PC (Program Counter) is changed to point to an address backward in the instruction stream. ⊳ (^) A static predictor looks for the offset of the conditional branch and predicts to take 8
Some of the proposed dynamic branch prediction mechanisms include: ⊳ (^) Uses a Branch History Table (BHT), a table of usually two-bit saturating counters which is indexed by a portion of the branch address (low bits of address). ⊳ (^) (First proposed mid 1980s) – Two-Level Adaptive Branch Predictor. ⊳ To reduce the stall cycles resulting from correctly predicted taken branches to zero cycles, a Branch Target Buffer (BTB) that includes the addresses of conditional branches that were taken along with their targets is added to the fetch stage. 10 Dynamic Branch Prediction Mechanisms Dynamic Branch Prediction Mechanisms
Branch History Table (BHT) Branch History Table (BHT) Also known as One Level Bit Branch Predictor 11
Branch History TableBranch History Table 13
Two Level Bit Predictor Two Level Bit Predictor
Two Level Bit Predictor Two Level Bit Predictor 16
19
20 Thanks! Thanks!