Static branch prediction
Static Branch Prediction predicts always the same direction for the same branch during the whole program execution.
It comprises hardware-fixed prediction and compiler-directed prediction.
Simple hardware-fixed direction mechanisms can be:
- Predict always not taken
- Predict always taken
- Backward branch predict taken, forward branch predict not taken
Sometimes a bit in the branch opcode allows the compiler to decide the prediction direction.