Auto CPU Dispatch (IA-32 only)

The -ax{M|i|K|W} options direct the compiler to find opportunities to generate separate versions of functions that use instructions supported on the specified processors (see table below). 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 the function. The generic version will run on any IA-32 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 benefit from performance gains on more advanced processors, while still working properly on older processors.

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

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

Option Optimizes for...
-axM Intel® Pentium® processors with MMX(TM) technology
-axi Intel Pentium Pro and Intel Pentium II processors
-axK Intel Pentium III processors. Implies i and M instructions.
-axW Intel Pentium 4 processors, Intel® Xeon(TM) processors, and Intel® Pentium® M processors. Implies M, i, and K instructions.

Example

The compilation below will generate a single executable that includes:

prompt>icc -axKW prog.c