Lukas' Notes

branch-prediction

Definition

Backwards Taken Forwards Not Taken Branch Prediction

Backwards taken, forwards not taken (BTFNT) is a static branch prediction heuristic that predicts a branch based on the sign of its offset.

  • If the branch target lies behind the current PC (negative offset), the branch is predicted taken — these are typically loop back-edges.
  • If the target lies ahead (positive offset), the branch is predicted not taken — these are typically forward branches in if–else constructs where the fall-through path is common.

BTFNT uses no runtime history and requires no storage. The prediction is determined entirely by the branch offset encoded in the instruction.