Next: ``Cancelling'' branches
Up: Control HazardsBranch Prediction
Previous: ...
Where to get instructions to fill branch delay slot?
- Before branch instruction
- From the target address (only useful if branch taken)
- From fall-through (only useful if not taken)
- May need to add code to cancel effect of
delay slot instructions inadvertently executed,
eg at end of a loop
How well do compilers do?
- Fills about 60% of branch delay slots
- Of these, about 80% actually contribute usefully
- Overall effectiveness: 60%
80% = 50% - Effective average branch delay
50%
It is much harder to make effective use of multiple delay slots
Paul H J Kelly
Mon Dec 1 20:07:28 GMT 1997