Next: Branch delays in a deeper pipeline
Up: Control Hazards, Branch Prediction
Previous: ...
Cancelling (or ``nullifying'') branches are a variation
on delayed branches.
Idea:
- Get compiler to predict whether branch is
probably taken or not
- Have two variants of delayed branch -
- BEQZL ``branch likely'': predicted taken, ie delayed branch, cancel if not taken
- BEQZU ``branch unlikely'': predicted not-taken, ie
delayed branch, cancel if taken
- Squash the delay slot's updates if mispredicted
Unfortunately, compilers are not very good at predicting branches.
Profile-based branch prediction improves performance substantially.