user manual

22007E/0November 1999 AMD Athlon Processor x86 Code Optimization
Ensure Floating-Point Variables and Expressions are of Type Float 13
3
C Source Level Optimizations
This chapter details C programming practices for optimizing
code for the AMD Athlon processor. Guidelines are listed in
order of importance.
Ensure Floating-Point Variables and Expressions are of
Type Float
For compilers that generate 3DNow! instructions, make sure
that all floating-point variables and expressions are of type
float. Pay special attention to floating-point constants. These
require a suffix of F or f (for example, 3.14f) in order to be
of type float, otherwise they default to type double. To avoid
automatic promotion of float arguments to double, always use
function prototypes for all functions that accept float
arguments.
Use 32-Bit Data Types for Integer Code
Use 32-bit data types for integer code. Compiler
implementations vary, but typically the following data types are
includedint, signed, signed int, unsigned, unsigned int, long,
signed long, long int, signed long int, unsigned long, and unsigned
long int.