Instruction prefetch
From Wikipedia, the free encyclopedia
It has been suggested that this article or section be merged with Prefetch input queue. (Discuss) |
This article does not cite any references or sources. (May 2008) Please help improve this article by adding citations to reliable sources. Unverifiable material may be challenged and removed. |
In computer architecture, instruction prefetch is a technique used in microprocessors to speed up the execution of a program by reducing wait states.
Modern microprocessors are much faster than the memory where the program is kept, meaning that the programs instructions cannot be read fast enough to keep the microprocessor busy. Adding a cache can provide faster access to needed instructions.
Prefetching occurs when a processor requests an instruction from main memory before it is actually needed. Once the instruction comes back from memory, it is placed in a cache. When an instruction is actually needed, the instruction can be accessed much more quickly from the cache than if it had to make a request from memory.
Since programs are generally executed sequentially, performance is likely to be best when instructions are prefetched in program order. Alternatively, the prefetch may be part of a complex branch prediction algorithm, where the processor tries to anticipate the result of a calculation and fetch the right instructions in advance. In the case of dedicated hardware (like a Graphics Processing Unit) the prefetch can take advantage of the spatial coherence usually found in the texture mapping process. In this case, the prefetched data are not instructions, but texture elements (texels) that are candidates to be mapped on a polygon.
The first mainstream microprocessors to use some forms of instruction prefetch were the Intel 80286 and the Motorola 68020.
[edit] References
- Halstead, Robert; Ward, Stephen (1989). Computation Structures. MIT Press, 812. ISBN 0-262-23139-5.