AMD x86 manual Avoid the Loop Instruction, Avoid Far Control Transfer Instructions

Models: x86

1 256
Download 256 pages 58.62 Kb
Page 81
Image 81

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).

Avoid the Loop Instruction

65

Page 81
Image 81
AMD x86 manual Avoid the Loop Instruction, Avoid Far Control Transfer Instructions