Speculative Loads
Since computer chips have been created, processors speeds have gotten much
much faster. Processors have gotten so fast that many cycles are
wasted while the CPU is waiting for data to come from memory. Speculative
loading is another key feature to the EPIC chip, and does a good job at
keeping the number of cycles spent waiting for data to come from memory
down to a minimum. Speculative loading allows the CPU to bring a load instruction
up further in the instruction stream (even before a branch sometimes) and
load data before it is needed. It then inserts a speculative load check
in the spot where the data was originally supposed to be fetched. The idea
is to keep the data fetching and the use of the data separate. When a speculative
load instruction is placed in the instruction stream, the CPU doesn't have
to sit around, doing nothing for lots of cycles waiting for the data to
come from memory.
The process of speculative loading is done by the compiler. First the
compiler scans the program, looking for any data that will need to be fetched
from memory. Then the compiler inserts many speculative loads in earlier
parts of the program, before the data will be used, and speculative load
checks where the data is going to be used. At the same time the compiler
is finding instructions that can be executed in parallel. When the CPU
encounters a speculative load instruction, it tries to load the data from
memory. If it is okay to fetch the data, then the program will fetch
and use it. If fetching the data is not okay to fetch, it will post
an exception.
|