| How a CPU Works | |
| By Gabriel Torres on September 26, 2005 | Page 9 of 9 |
![]()
Speculative Execution Let’s suppose that one of this generic instructions is a conditional branching. What will the out-of-order engine do? If the CPU implements a feature called speculative execution (all modern CPUs do), it will execute both branches. Consider the example below: 1. generic instruction When the out-of-order engine analyses this program, it will pull instruction 15 into one of the FPUs, since it will need one math to fill one of the FPUs that otherwise would be idle. So at a given moment we could have both branches being processed at the same time. If when the CPU finishes processing the third instruction a is greater than b, the CPU will simple discard the processing of instruction 15. You may think this is a waste of time, but in fact it is not. It doesn’t cost anything to the CPU to execute that particular instruction, because the FPU would be otherwise idle anyway. On the other hand, if a=<b the CPU will have a performance boost, since when instruction 3 asks for instruction 15 it will be already processed, going straight to instruction 16 or even further, if instruction 16 has also already been processed by the out-of-order engine. Of course everything we explained on this tutorial is an over simplification in order to make this very technical subject easier to understand. Read our Inside Pentium 4 Architecture tutorial in order to study the architecture of Pentium 4 processor. We will be also posting an Athlon 64 architecture tutorial very soon. | |
| Originally at http://www.hardwaresecrets.com/article/209/9 | Pages (9): 1 2 3 4 5 6 7 8 » ... Last » |
© 2004-8, Hardware Secrets, LLC. All Rights Reserved. Total or partial reproduction of the contents of this site, as well as that of the texts available for downloading, be this in the electronic media, in print, or any other form of distribution, is expressly forbidden. Those who do not comply with these copyright laws will be indicted and punished according to the International Copyrights Law. We do not take responsibility for material damage of any kind caused by the use of information contained in Hardware Secrets. | |