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: C/C++ > Optimization > Use Intel(R) Processor Extensions

Linux: Code Generation > Use Intel(R) Processor Extensions

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.
  T Code is optimized for Intel® Core™2 Duo processors, Intel® Core™2 Extreme processors, and the Dual-Core Intel® Xeon® processor 5100 series.

Default

OFF No processor specific code is generated, except as controlled by option -x (Linux and Mac OS) or /Qx (Windows).

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, P, and T 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