Apex › Systems & OS

Branch prediction

How a CPU guesses which way a branch goes before it knows, so the pipeline doesn't stall. Step a 2-bit saturating counter through a branch-outcome pattern and watch the hysteresis at work — then compare its mispredictions against a 1-bit predictor on the loop-exit pattern, where the extra bit halves the misses.

More in Systems & OS