Cache And Memory Optimizations; Memory Size And Alignment Issues; Avoid Memory Size Mismatches - AMD Athlon Processor x86 Optimization Manual

X86 code optimization
Table of Contents

Advertisement

22007E/0—November 1999

Memory Size and Alignment Issues

Avoid Memory Size Mismatches

TOP
Memory Size and Alignment Issues
Cache and Memory
Optimizations
This chapter describes code optimization techniques that take
advantage of the large L1 caches and high-bandwidth buses of
the AMD Athlon™ processor. Guidelines are listed in order of
importance.
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. The following code examples result in a
store-to-load-forwarding (STLF) stall:
Example 1 (Avoid):
MOV
DWORD PTR [FOO], EAX
MOV
DWORD PTR [FOO+4], EDX
FLD
QWORD PTR [FOO]
Avoid large-to-small mismatches, as shown in the following
code:
Example 2 (Avoid):
FST
QWORD PTR [FOO]
MOV
EAX, DWORD PTR [FOO]
MOV
EDX, DWORD PTR [FOO+4]
AMD Athlon™ Processor x86 Code Optimization
5
45

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the Athlon Processor x86 and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

Table of Contents