Avoid the Loop Instruction
65
22007E/0—November 1999
AMD Athlon™ Processor x86 Code Optimization
Avoid the Loop Instruction
The LOOP instruction in the AMD Athlon processor requires
eight cycles to execute. Use the preferred code shown below:
Example 1 (Avoid):
LOOP
LABEL
Example 2 (Preferred):
DEC
ECX
JNZ
LABEL
Avoid Far Control Transfer Instructions
Avoid using far control transfer instructions. Far control
transfer branches can not be predicted by the branch target
buffer (BTB).
Summary of Contents for Athlon Processor x86
Page 1: ...AMD Athlon Processor x86 Code Optimization Guide TM...
Page 12: ...xii List of Figures AMD Athlon Processor x86 Code Optimization 22007E 0 November 1999...
Page 16: ...xvi Revision History AMD Athlon Processor x86 Code Optimization 22007E 0 November 1999...
Page 202: ...186 Page Attribute Table PAT AMD Athlon Processor x86 Code Optimization 22007E 0 November 1999...
Page 252: ...236 VectorPath Instructions AMD Athlon Processor x86 Code Optimization 22007E 0 November 1999...
Page 256: ...240 Index AMD Athlon Processor x86 Code Optimization 22007E 0 November 1999...