22007E/0 — November 1999

AMD Athlon™ Processor x86 Code Optimization

Avoid Placing Code and Data in the Same 64-Byte Cache Line

 

Consider that the AMD Athlon processor cache line is twice the

TOP

size of previous processors. Code and data should not be shared

in the same 64-byte cache line, especially if the data ever

becomes modified. In order to maintain cache coherency, the

 

AMD Athlon processor may thrash its caches, resulting in lower

 

performance.

In general the following should be avoided:

Self-modifying code

Storing data in code segments

See “Avoid Placing Code and Data in the Same 64-Byte Cache

Line” on page 50 for more details.

Group II Optimizations —Secondary Optimizations

11

Page 27
Image 27
AMD x86 manual Avoid Placing Code and Data in the Same 64-Byte Cache Line