AMD x86 Manuale Utente

Pagina di 256
8
Optimization Star
AMD Athlon™ Processor x86 Code Optimization 
22007E/0—November 1999
Avoid Placing Code and Data in the Same 64-Byte Cache
Line
Optimization Star
The top optimizations described in this chapter are flagged
with a star. In addition, the star appears beside the more
detailed descriptions found in subsequent chapters.
Group I Optimizations — Essential Optimizations
Memory Size and Alignment Issues
Avoid Memory Size Mismatches
Avoid memory size mismatches when instructions operate on
the same data. For instructions that store and reload the same
data, keep operands aligned and keep the loads/stores of each
operand the same size.
Align Data Where Possible
Avoid misaligned data references. A misaligned store or load
o p e ra t i on   su f f e rs   a  m i n imum   o n e -cy c l e   p e n a lty   i n   t h e
AMD Athlon processor load/store pipeline.
Use the 3DNow!™ PREFETCH and PREFETCHW Instructions
For code that can take advantage of prefetching, use the
3DNow! PREFETCH and PREFETCHW instructions to increase
the effective bandwidth to the AMD Athlon processor, which
s i g n i fi c a n tly   i m p rove s   p e r fo r m a n c e .   A l l   t h e   p re f e tch
instructions are essentially integer instructions and can be used
TOP
TOP
TOP
TOP