Dynamic Branch Prediction
Assuming that a branch is not taken is a crude form of prediction
- If 50% of branches are taken, we will be right 50% of the time
To do better than this, we can examine past behavior of the branch to hint what will happen this time
We maintain a small branch prediction buffer or branch history table
- The table is indexed by the low order bits of branch instruction addresses (why not the high order bits?)
- Each entry is a single bit which tells us whether the branch was taken
Improves accuracy to 80-90%