The -ax (Linux*) or /Qax (Windows*) options direct the compiler to find opportunities to generate separate versions of functions that take advantage of features in a specific Intel® processor.
If the compiler finds such an opportunity, the compiler first checks whether generating a processor-specific version of a function is likely to result in a performance gain. If the compiler determines there is a likely performance gain, it 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 generated versions executes depending on the Intel processor being used. Using this strategy, the program can benefit from performance gains on more advanced Intel processors, while still working properly on older IA-32 processors.
Windows* |
Linux* |
Optimizes code for... |
---|---|---|
/QaxK |
-axK |
Pentium® III and compatible Intel processors |
/QaxW |
-axW |
Pentium 4 and compatible Intel processors |
/QaxN |
-axN |
Pentium 4 and compatible Intel processors |
/QaxB |
-axB |
Pentium M and compatible Intel processors |
/QaxP |
-axP |
Intel® Core™ Duo processors and Intel® Core™ Solo processors, Intel Pentium 4 processors with Streaming SIMD Extensions 3, and compatible Intel processors with Streaming SIMD Extensions 3 (SSE3) |
/QaxT |
-axT |
Intel® Core™2 Duo processors, Intel® Core™2 Extreme processors, and the Dual-Core Intel® Xeon® processor 5100 series |
On Intel® EM64T systems, W, P, and T are the only valid processor values. On Intel-based systems running Mac OS*, P is the only valid processor value.
The following compilation examples demonstrate how to generate an executable that includes:
An optimized version for Pentium 4 processors, as long as there is a performance gain
An optimized version for Pentium M processors, as long as there is a performance gain
A generic version that runs on any IA-32 processor
Platform |
Example |
---|---|
Linux |
icc -axNB prog.cpp |
Windows |
icl /QaxNB prog.cpp |
For more information about the options listed in the table above, see the following topic:
-ax compiler option
The disadvantages of using -ax (Linux) or /Qax (Windows) are:
The size of the compiled binary increases because it contains processor-specific versions of some of the code, as well as a generic version of the code.
Performance is affected slightly by the run-time checks needed to determine which code to use.
Applications that you compile with this option will execute on any IA-32 processor. If you specify both the -x (Linux) or /Qx (Windows) and -ax (Linux) or /Qax (Windows) options, the -x (Linux) or /Qx (Windows) option forces the generic code to execute only on processors compatible with the processor type specified by the -x (Linux) or /Qx (Windows) option.