Branch prediction is done by the processor to try to determine where the execution will continue after a conditional jump, so that it can read the next instruction(s) from memory.

Speculative execution goes one step further and determines what the result would be from executing the next instruction(s). If the branch prediction was correct, the result is used, otherwise it is discarded.

如果想详细了解,需要阅读Introduction to Tomasulo’s Algorithm


参考资料:

  1. difference between speculation and prediction
  2. Hardware Based Speculation
  3. cs246-lecture-speculation
  4. Study of Speculative Execution and Branch Prediction