Next: ...
Up: Control Hazards, Branch Prediction
Previous: One-bit branch prediction
Consider the conditional branch in a loop:
label:
body of loop
SUBI R1,R1,#1
BNEZ R1,label
- Suppose the loop is executed 9 times
- Branch is taken 9 times, not taken once
- What is the prediction accuracy, assuming
the prediction bit for the branch remains
in the prediction buffer?