The -ax (Linux*) or /Qax (Windows*) options direct the compiler to find opportunities to generate separate versions of functions that take advantage of features specific to a specific IntelŪ processor.
If the compiler finds such an opportunity, it first checks whether generating a processor-specific version of a function is likely to result 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 versions is chosen to execute, depending on the Intel processor in use. In this way, 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 |
Pentium 4 processors with Streaming SIMD Extensions 3 (SSE3) instruction support |
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 to determine which code to use.
Note
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
The following compilation examples generate a single executable that includes:
a generic version for use on any IA-32 processor
a version optimized for Pentium 4 processors, as long as there is a performance benefit
a version optimized for Pentium M processors, as long as there is a performance benefit
Platform |
Example |
---|---|
Linux |
ifort -axNB prog.f90 |
Windows |
ifort /QaxNB prog.f90 |