"매 modern CPU 의 IPC 핵심 mechanism — 그리고 Spectre 의 attack surface.". Branch predictor 는 conditional/indirect branch 의 결과를 speculatively execute 함으로써 deep pipeline 의 stall 을 회피; 매 misprediction penalty 는 15-20+ cycles, 매 mispredicted speculative window 가 Spectre v1/v2 의 leak vector.
매 핵심
매 Predictor 종류
Static: forward-not-taken, backward-taken (hint).
Bimodal (2-bit): per-PC saturating counter.
Local history: per-branch shift register.
Global history (gshare/GAg): shared GHR XOR PC.
Tournament: meta-predictor selects local vs global.
TAGE / ITTAGE: tagged geometric history (modern SOTA).
Perceptron: AMD Zen — neural-style predictor.
매 Indirect Branches
BTB (Branch Target Buffer) — caches target.
ITTAGE for indirect.
Critical for vtables, function pointers, switch.
매 응용
Hot loops — predictable branches → near-zero penalty.