You are correct. Speculative execution is a slightly more generic term. Speculative execution enables the correct execution of incorrectly predicted branches, by either backing up, or never committing in the first place until you are sure. Branch prediction -- per se -- involves building a cache of branches & their expected targets. For example, the conditional branch terminating a loop is very highly likely to continue the loop. In some cases, the probability of terminating the loop is approaching the probability of certain hardware failures, so one "reasonable" compiler optimization might be to eliminate the conditional altogether and simply continue the loop forever ! I have long mused on the subject of "reversible execution" -- i.e., instructions which could be run backwards. Presumably, this would enable cheaper speculative execution, since you wouldn't have to store as much state. The analogy is with biology, in which operations such as DNA copying move forward only probabilistically, but with a definite forward bias. At 07:25 AM 5/21/2014, Joerg Arndt wrote:
* Henry Baker <hbaker1@pipeline.com> [May 21. 2014 16:09]:
Warren:
[...]
Branch prediction basically builds several hypothetical states in parallel (requiring lots of additional registers), and only when the results of the decisions are finally available does the CPU choose the correct state to "instantiate" as the actual state.
This is what I'd call "speculative execution".
Best regards, jj
[...]