Specialized Code with -ax{i|M|K|W}

When the -ax{i|M|K|W} option is used, your compiled application includes processor-specific extensions. When the compiled application is run, it detects the extensions supported by the processor:

Applications compiled with -ax{i|M|K|W} have increased code size, but increased performance over standard optimized code.

Note
Applications that you compile with this option will execute on any Intel 32-bit processor. Such compilations are, however, subject to any exclusive specialized code restrictions you impose during compilation with the -x option.

-ax Summary

To Optimize for... Use this option
Intel® PentiumŪ Pro and Pentium II processors, which use the CMOV and FCMOV, and FCOMI instructions -axi
Pentium processors with MMX(TM) technology instructions -axM
Pentium III processor with the Streaming SIMD Extensions, implies i and M instructions -axK
Pentium 4 processor with the Streaming SIMD Extensions 2, implies i, M, and K instructions -axW

Checking for Performance Gain

The -ax{i|M|K|W} option directs the compiler to find opportunities to generate separate versions of functions that use instructions supported on the specified processors. If the compiler finds such an opportunity, it first checks whether generating a processor-specific version of a function results in a performance gain. If this is the case, the compiler generates both a processor-specific version of a function and a generic version of that function that will run on any IA-32 architecture processor.

At run time, one of the two versions is chosen to execute depending on the processor the program is currently running on. In this way, the program can get large performance gains on more advanced processors, while still working properly on older processors.

The disadvantages of using -ax{i|M|K|W} are: