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

TOP

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

See “Memory Size and Alignment Issues” on page 45 for more details.

Avoid Memory Size Mismatches

 

Avoid memory size mismatches when instructions operate on

TOP

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

TOP

operation suffers a minimum one-cycle penalty in the

 

AMD Athlon processor load/store pipeline.

Use the 3DNow!™ PREFETCH and PREFETCHW Instructions

 

For code that can take advantage of prefetching, use the

TOP

3DNow! PREFETCH and PREFETCHW instructions to increase

the effective bandwidth to the AMD Athlon processor, which

significantly improves performance. All the prefetch

instructions are essentially integer instructions and can be used

8

Optimization Star

Page 24
Image 24
AMD x86 manual Optimization Star, Group I Optimizations Essential Optimizations, Memory Size and Alignment Issues