AMD Athlon Processor x86 Optimization Manual page 5

X86 code optimization
Table of Contents

Advertisement

22007E/0-November 1999
Use 8-Bit Sign-Extended Displacements. . . . . . . . . . . . . . . . . . . . . . . 39
Code Padding Using Neutral Code Fillers . . . . . . . . . . . . . . . . . . . . . 39
5
Memory Size and Alignment Issues . . . . . . . . . . . . . . . . . . . . . . . . . . 45
Take Advantage of Write Combining . . . . . . . . . . . . . . . . . . . . . . . . . 50
Store-to-Load Forwarding Restrictions. . . . . . . . . . . . . . . . . . . . . . . . 51
Stack Alignment Considerations . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54
C Language Structure Component Considerations . . . . . . . . . . . . . . 55
Sort Variables According to Base Type Size . . . . . . . . . . . . . . . . . . . 56
6
Avoid Branches Dependent on Random Data . . . . . . . . . . . . . . . . . . 57
Always Pair CALL and RETURN . . . . . . . . . . . . . . . . . . . . . . . . . . . . 59
Avoid the Loop Instruction . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 65
Avoid Far Control Transfer Instructions . . . . . . . . . . . . . . . . . . . . . . 65
Avoid Recursive Functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 66
Contents
AMD Athlon Processor Blended Code . . . . . . . . . . . . . . . . . . . 41
Avoid Memory Size Mismatches . . . . . . . . . . . . . . . . . . . . . . . . 45
Align Data Where Possible . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
AMD Athlon Processor Specific Code . . . . . . . . . . . . . . . . . . . 58
Muxing Constructs . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 60
Sample Code Translated into 3DNow! Code . . . . . . . . . . . . . . 61
AMD Athlon™ Processor x86 Code Optimization
®
45
57
v

Advertisement

Table of Contents
loading

Table of Contents