
Ask HN: What was the first CPU to implement speculative execution? - DeepYogurt
Hi all,<p>Does anyone know what the first cpu design to support speculative execution was? Everything I can find on the subject mentions that speculative execution is essential for modern designs, but none mention where the idea comes from.
======
pwg
The answer will depend upon how broadly you define "speculative execution".

If you define it broadly as any form of computation before you know for sure
you will need to perform the computation, then items such as Tomasulo’s
algorithm from January 1967 can be seen as a form of speculative execution
([https://en.wikipedia.org/wiki/Tomasulo_algorithm](https://en.wikipedia.org/wiki/Tomasulo_algorithm)).
It was implimented in the IBM 360/91 mainframe.

If instead you define "speculative execution" as needing some form of branch
prediction and execution of a predicted branch path then the Wikipedia article
on branch prediction
([https://en.wikipedia.org/wiki/Branch_predictor](https://en.wikipedia.org/wiki/Branch_predictor))
cites a publication by Yeh & Patt (item 14 in the citations list) dated from
1991. There are likely earlier pubs, but that one provides a 27 year old age
for the technique. The reason that this places a age on the technique is that
the moment you begin 'predicting' a branch and executing instructions down the
'predicted' path before you know for sure the branch outcome, you are
"speculatively executing" instructions (executing them before you know for
sure you do in fact need to execute them).

~~~
DeepYogurt
Many thanks for the comprehensive answer. I hadn't actually considered how I
defined "speculative execution". I suppose what I meant is a cpu which will
execute more than one path in a branch and discard those branches which are
not taken. Either way, I was expecting the answer to be something like the AMD
hammer or something around there. Clearly off by a bit :)

------
daly
The 360/91 would throw an "imprecise interrupt" error indicating that the
error occurred somewhere in the last (dozen?) instructions.... which caused me
untold hours of grief. Which branch ended up here?

