0
$\begingroup$

I'm studying for an exam on Advanced Computer Architecture and in an exam question the question above is asked.

I know that branch prediction is crucial in superscalar processors in order to exploit ILP as much as possible, but I was wondering what could be the precise reason why superscalar processors use dynamic branch prediction instead of static one.

Update:

Hi again, as the two comments below suggested, I tried to think about it and thought that in case of a misprediction a processor using branch predictor has to flush the pipeline from the incorrect instructions issued because of the prediction.

So, for a superscalar processor issuing multiple instructions at the same time, the penalty would be much higher, but I'm still not sure this is the real point...

Any other help?

$\endgroup$
  • $\begingroup$ This sounds like a good test of your understanding. What are your thoughts? Can you think of any possible reasons? What are the advantages and disadvantages of dynamic branch prediction vs static branch prediction? $\endgroup$ – D.W. Jan 25 '18 at 1:17
  • 1
    $\begingroup$ Just to further expand on D.W.'s idea, pick a good static branch predictor that you know about (even a simple one) and think about under what circumstances it might not do a good job. $\endgroup$ – Pseudonym Jan 25 '18 at 5:40
  • $\begingroup$ It is about balance and efficiency. There is no need to put many transistors in superscalar execution units if the fetch/prefetch part is not able to provide a continuous stream of instructions. This is best achieved using dynamic branch prediction, call stack optimisation, ... $\endgroup$ – TEMLIB Jan 28 '18 at 0:45
2
$\begingroup$

What you want from a branch predictor: Low implementation cost, prediction speed (you don't want to wait for branch prediction), and high accuracy (high percentage of correctly predicted branches).

So compare static and dynamic branch prediction: Dynamic branch prediction is more expensive, after all it needs to store the history of branches. Dynamic branch history is as fast as static prediction, but its accuracy is enormously higher.

The logical consequence is that when you build a chip that is going to be expensive and high performance anyway, you are not going to scrimp on the cost of branch prediction and use the more accurate method.

And look at Pseudonym's comment: Look at what a static branch predictor does, and see why it will be often less good than dynamic prediction. (Not always. Any dynamic branch prediction can be tricked into always predicting wrong).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.