
The Sentry Branch Predictor Spec: A Fairy Tale - dsr_
http://clarkesworldmagazine.com/chu_07_16/
======
Animats
That's very cute. There's a long history of trying to improve guesses about
branch prediction. Some machines (POWER, PA-RISC, Itanium) had instruction
bits for hints from the programmer on how likely a branch was.[1] That seems
to have been a dead end.

It's common to read about the front end of the pipeline, where instructions
come in. We never seem to hear much about the back end, the retirement unit,
where results come out and conflicts are resolved. Some of those results are
bogus because the branch prediction was wrong. They have to be dropped. Some
results are bogus because there was a clash between two instructions storing
into the same memory location. All the hard cases come together in the
retirement unit, which has nowhere else to pass the buck. Ones for x86 are
said to be very complicated.

Worst case is a store into the code immediately ahead of execution. x86
machines have to handle this. Once, that was an optimization. Today, it's a
pessimization; superscalar x86 CPUs tend to flush their entire state when that
happens and restart the pipeline cold.

