9 Types of Two Level Branch Predictor
9 Types of Two Level Branch Predictor
Predictor
Detailed Explanation of the 9 Types of Two-Level Adaptive Branch Predictors
The Two-Level Adaptive Branch Predictor, introduced by Yeh and Patt (1991), is an
advanced dynamic branch prediction technique that achieves high accuracy by using two
levels of branch history tracking:
1. First Level (Branch History Register - BHR or BHSR) → Captures recent branch
outcomes.
2. Second Level (Pattern History Table - PHT) → Uses history patterns to predict
future branches.
Yeh and Patt categorized nine different implementations of two-level predictors based on:
Branches are divided into sets; each set shares a history register.
Uses hashing or PC-based partitioning.
Advantage: Reduces aliasing while using less storage than P.
Disadvantage: Some aliasing remains.
By using historical branch behavior, these predictors dynamically refine their predictions,
reducing mispredictions and improving performance in modern superscalar processors.
NVIDIA & AMD GPUs employ two-level branch prediction to optimize shaders
and parallel execution.
6. Summary
1️ Two-level adaptive prediction improves accuracy by tracking historical branch
patterns.
2️ Nine different variations exist, balancing accuracy, storage, and aliasing reduction.
3️ Global (G), Per-Address (P), and Per-Set (S) history tracking determines first-level
behavior.
4️ Global (g), Per-Address (p), and Per-Set (s) pattern tables define second-level
behavior.
5️ Adaptive predictors dynamically learn and adjust to changing program behavior,
making them highly efficient for modern processors.
These predictors are widely used in high-performance CPUs and help maintain pipeline
efficiency in superscalar architectures. 🚀