IT lexicon Hardware Branch target buffer (BTB)

Branch target buffer (BTB)

Hardware På svenska → Updated: 2026-05-29

A cache in the CPU that remembers where previous branches (jumps) led, so the processor can predict the target address of a jump before it has actually computed it. Crucial for keeping the speculative pipeline fed without stalling.

Problem: when the CPU hits a branch (an if statement, function call, loop) it doesn't immediately know where it leads — but a deep pipeline can't wait. The branch predictor guesses IF the branch is taken; the BTB guesses WHERE it leads (the target address) based on history, so fetching can continue immediately from the right place. If the BTB guesses right the pipeline rolls on without interruption; if it guesses wrong the speculatively fetched instructions must be discarded (an expensive "flush"). Related: the return stack buffer (specialized for function returns). The BTB's accuracy affects performance directly, and its behavior has also been exploited in side-channel attacks (Spectre variants). A core component of modern branch prediction. Related to return stack buffer and speculative execution.

← Back to the lexicon