ax, Qax

Directs the compiler to generate processor-specific code if there is a performance benefit, while also generating generic IA-32 code.

IDE Equivalent

Windows: Optimization > Use Intel(R) Processor Extensions
Linux: None
Mac OS: None

Architectures

IA-32, IntelŪ EM64T

Syntax

Linux and Mac OS: -axprocessor
Windows:  /Qaxprocessor

Arguments

processor Is the processor for which you want to target your program. Possible values are:
  K Code is optimized for IntelŪ PentiumŪ III and compatible Intel processors.
  W Code is optimized for Intel Pentium 4 and compatible Intel processors.
  N Code is optimized for Intel Pentium 4 and compatible Intel processors.
This option also enables new optimizations in addition to Intel processor-specific optimizations.
  B Code is optimized for Intel Pentium M and compatible Intel processors.
This option also enables new optimizations in addition to Intel processor-specific optimizations.
  P Code is optimized for IntelŪ Core™ Duo processors, IntelŪ Core™ Solo processors, IntelŪ PentiumŪ 4 processors with Streaming SIMD Extensions 3, and compatible Intel processors with Streaming SIMD Extensions 3. This option also enables new optimizations in addition to Intel processor-specific optimizations.

Default

Windows and Linux: OFF
Mac OS: -xP
On Windows and Linux, no processor-specific code is generated by the compiler. On Mac OS systems, code is optimized for IntelŪ Core™ Duo processors and IntelŪ PentiumŪ 4 processors with Streaming SIMD Extensions 3 (SSE3) instruction support.

Description

This option directs the compiler to generate processor-specific code if there is a performance benefit, while also generating generic IA-32 code. The generic code is usually slower than the specialized code.

It enables the vectorizer and tells the compiler to find opportunities to generate separate versions of functions that take advantage of features of the specified 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.

On IntelŪ EM64T systems, W and P are the only valid processor values.

On Mac OS systems, P is the only valid processor value. On these systems, -axP is equivalent to -xP, which is the default and is always set.

You can use more than one of the processor values by combining them. For example, you can specify -axNB (Linux) or /QaxNB (Windows) to generate code for IntelŪ PentiumŪ 4 processors and Intel Pentium M processors.

If you specify both the -ax and -x options (Linux) or the /Qax and /Qx options (Windows), the generic code will only execute on processors compatible with the processor type specified by the -x or /Qx option.

Alternate Options

None

See Also

x compiler option