Next: Branch folding
Up: Control HazardsBranch Prediction
Previous: The Branch Target Buffer
- You must check that the prediction actually refers to
the current PC (cf tag check in cache)
- BTB also includes branch prediction state bits,
and is updated when branch prediction
changes
- Must minimise cost of misprediction.
E.g. also fetch the predicted-not-taken
instruction
- Reduces branch delay to zero
- Can also predict virtual function calls
- Predicting function returns is
harder; see H&P pp.277
Paul H J Kelly
Mon Dec 1 20:07:28 GMT 1997