user manual

22007E/0November 1999 AMD Athlon Processor x86 Code Optimization
Use 3DNow! Instructions 107
10
3DNow! and MMX
Optimizations
This chapter describes 3DNow! and MMX code optimization
techniques for the AMD Athlon processor. Guidelines are
listed in order of importance. 3DNow! porting guidelines can be
found in the 3DNow! Instruction Porting Guide, order# 22621.
Use 3DNow! Instructions
Unless accuracy requirements dictate otherwise, perform
floating-point computations using the 3DNow! instructions
instead of x87 instructions. The SIMD nature of 3DNow!
achieves twice the number of FLOPs that are achieved through
x87 instructions. 3DNow! instructions provide for a flat register
file instead of the stack-based approach of x87 instructions.
See the 3DNow! Technology Manual, order# 21928 for
information on instruction usage.
Use FEMMS Instruction
Though there is no penalty for switching between x87 FPU and
3DNow!/MMX instructions in the AMD Athlon processor, the
FEMMS instruction should be used to ensure the same code
also runs optimally on AMD-K6
®
family processors. The
TOP