Computer Architecture · Cluster

Branch Prediction

Speculation, misprediction cost, and recovery.

  1. 01 The Control Hazard and Why Fetch Must Guess the Next Instruction How a pipelined front end turns every branch into a bet, what a wrong bet costs in cycles, and why stalling instead of guessing is worse than it looks. foundational · May 12, 2022
  2. 02 Static Branch Prediction and the Branch Delay Slot How compilers and instruction sets answered the control hazard before dynamic predictors existed, and why delay slots were abandoned once pipelines got deeper. foundational · May 13, 2026
  3. 03 Two-Bit Saturating Counters and the Bimodal Predictor Why a two-bit hysteresis counter beats a single bit for branch prediction, how the index is computed, and where the table fails: aliasing, short loops, and correlated branches. foundational · Jul 14, 2022
  4. 04 How a Branch Target Buffer Delivers the Target in the Fetch Cycle The BTB supplies a taken branch target before decode, which requires predicting the address as well as the direction and creates its own tagging, aliasing, and coherence problems. intermediate · Mar 22, 2023
  5. 05 Global History and the Gshare Index Hashing recent branch outcomes into the predictor index lets one branch learn from another; the mechanism, the XOR that spreads history across sets, and the interference it creates. intermediate · Oct 18, 2023
  6. 06 Misprediction Recovery: Checkpoints, Squash, and the Cost of Being Wrong How an out-of-order core unwinds speculative state when a branch resolves wrong, why checkpoints of the rename map beat walking a reorder buffer, and what limits recovery speed. intermediate · May 13, 2026
  7. 07 Return Address Stacks and the Prediction of Indirect Branches Why returns and indirect jumps cannot be predicted from address history alone, how a call stack mirror in the fetch unit handles returns, and what indirect predictors store instead. intermediate · Feb 11, 2022
  8. 08 Aliasing, Tournament Predictors, and Per-Branch Selection When two predictor tables disagree, a choice predictor decides which to believe; the mechanics of tagged entries, confidence counters, and the cost of mispredicting the chooser itself. advanced · May 17, 2025
  9. 09 Geometric History Lengths in TAGE Predictors How TAGE uses several tables with exponentially different history lengths, tagged entries, and a usefulness counter to pick the longest matching prediction without collapsing into aliasing. advanced · Feb 20, 2026
  10. 10 Speculative Execution and the Architectural Side Effects of a Wrong Guess Squashing removes speculative state from the architecture but not from caches, predictors, and timing; how that residual state becomes an observable channel and what mitigation costs. advanced · Jun 15, 2025