ax, Qax

Tells the compiler to generate multiple, processor-specific code paths if there is a performance benefit.

IDE Equivalent

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

Architectures

IA-32 architecture, Intel® 64 architecture

Syntax

Linux and Mac OS X: -axprocessor
Windows:  /Qaxprocessor

Arguments

processor Is a value used to target specific processors or microarchitectures for the optimized code paths. Possible values are:
  S Can generate specialized code paths using Intel® Streaming SIMD Extensions 4 (SSE4) Vectorizing Compiler and Media Accelerators instructions for future Intel processors that support the instruction set and it can optimize for the architecture.
  T Can generate specialized code paths for SSSE3, SSE3, SSE2, and SSE instructions for Intel processors, and it can optimize for the Intel® Core™2 Duo processor family.
  P Can generate specialized code paths for SSE3, SSE2, and SSE instructions for Intel processors, and it can  optimize for Intel processors based on Intel® Core™ microarchitecture and Intel Netburst® microarchitecture.
  B Deprecated. Can generate specialized code paths for SSE2 and SSE instructions for Intel processors, and it can optimize for Intel® Pentium® M processors.
  N Can generate specialized code paths for SSE2 and SSE instructions for Intel processors, and it can optimize for Pentium® 4 processors and Intel® Xeon® processors with SSE2.
  W Can generate specialized code paths for SSE2 and SSE instructions for Intel processors, and it can optimize for Intel Pentium® 4 processors and Intel® Xeon® processors with SSE2.
  K Can generate specialized code paths for SSE instructions for Intel processors and it can optimize for Intel® Pentium® III and Intel® Pentium® III Xeon® processors.

Default

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

Description

This option tells the compiler to generate multiple, processor-specific code paths if there is a performance benefit. It also generates a generic IA-32 architecture code path. The generic code is usually slower than the specialized code.

The generic code path is determined by the architecture specified by the -x (Linux and Mac OS X) or /Qx (Windows) option. While there are defaults for the -x or /Qx option that depend on the operating system being used, you can specify an architecture for the generic code that is higher than the default. The specified architecture becomes the effective minimum architecture for the generic code path.

If you specify both the -ax and -x options (Linux and Mac OS X) 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.

This option 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. 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 processors.

You can use more than one of the processor values by combining them. For example, you can specify -axTP (Linux and Mac OS X) or /QaxTP (Windows) to generate code for Intel® Core™2 Duo processors and Intel® Pentium® 4 processors with SSE3.

On Linux and Windows systems using Intel® 64 architecture, B, N, and K are not valid processor values.

On Mac OS X systems using IA-32 architecture, S, T, and P are the only valid processor values. On Mac OS X systems using Intel® 64 architecture, S and T are the only valid processor values.

Alternate Options

None

See Also

x, Qx compiler options