Avoid The Loop Instruction; Avoid Far Control Transfer Instructions - AMD Athlon Processor x86 Optimization Manual

X86 code optimization
Table of Contents

Advertisement

22007E/0—November 1999

Avoid the Loop Instruction

Avoid Far Control Transfer Instructions

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 using far control transfer instructions. Far control
transfer branches can not be predicted by the branch target
buffer (BTB).
AMD Athlon™ Processor x86 Code Optimization
65

Advertisement

Table of Contents
loading

Table of Contents