Dynamic branch prediction
Execution of a branch requires knowledge of:
- There is a branch but one can guess that every instruction is a branch for outcome prediction (i.e., prediction can be done at IF stage)
- Whether the branch taken/not taken (hence a branch prediction mechanism)
- If the branch is taken where is the target address (can be computed but can also be “precomputed”, i.e., stored in some table)
- If the branch is taken what is the instruction at the branch target address (saves the fetch cycle for that instruction)