x, Qx

Tells the compiler to generate specialized and optimized code for the processor that executes your program.

IDE Equivalent

Windows: C/C++ > Optimization > Require Intel(R) Processor Extensions

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

Mac OS: None

Architectures

IA-32 architecture, Intel® 64 architecture

Syntax

Linux and Mac OS: -xprocessor
Windows:  /Qxprocessor

Arguments

processor Is the processor for which you want to target your program. Possible values are:
  T Generates SSSE3, SSE3, SSE2, and SSE instructions for Intel processors and optimizes for the Intel® Core™2 Quad processor family, the Intel® Core™2 Duo processor family, and Intel® Xeon® processors with SSSE3.
  P Generates SSE3, SSE2, and SSE instructions for Intel processors and optimizes for the Intel® Core™ Duo processor, Pentium® 4 processor with SSE3, and Intel® Xeon® processor with SSE3.
  O Generates SSE3, SSE2, and SSE instructions and optimizes for the Intel® Core™2 Duo processor family. The code generated should run on any processor that supports SSE3, SSE2, and SSE instruction sets.
  B Generates SSE2 and SSE instructions for Intel processors and optimizes for the Intel® Pentium® M processor. This option performs other optimizations not enabled with W.
  N Generates SSE2 and SSE instructions for Intel processors and optimizes for the Intel® Pentium® 4 processor and Intel® Xeon® processor with SSE2. This option performs other specific optimizations not enabled with W.
  W Generates SSE2 and SSE instructions and optimizes for the Intel® Pentium® 4 processor and Intel® Xeon® processor with SSE2. See Description for use on other processors.
  K Generates SSE instructions and optimizes for the Intel® Pentium® III processor and Intel® Pentium III Xeon® processor. See Description for use on other processors

Default

Windows and Linux systems using IA-32 architecture: OFF
Windows and Linux systems using Intel® 64 architecture: -xW
Mac OS systems using IA-32 architecture: -xP
Mac OS systems using Intel® 64 architecture: -xT
On Windows and Linux systems using IA-32 architecture, no processor-specific code is generated by the compiler. On systems using Intel® 64 architecture, code is optimized for Intel® Pentium® 4 and compatible processors. On Mac OS systems using IA-32 architecture, code is optimized for Intel® Core™ Duo processors and Intel® Pentium® 4 processors with Streaming SIMD Extensions 3 (SSE3) instruction support. On Mac OS systems using Intel® 64 architecture, code is optimized for Intel® Core™2 Duo processors, Intel® Core™2 Extreme processors, and the Dual-Core Intel® Xeon® processor 5100 series.

Description

This option tells the compiler to generate specialized and optimized code for the processor that executes your program.

The specialized code generated by this option may run only on a subset of Intel processors.

This option can enable many optimizations depending on which argument is specified.  For example, it may enable Supplemental SIMD Extensions 3 (SSSE3), SIMD Extensions 3 (SSE3), SIMD Extensions 2 (SSE2), or SIMD Extensions (SSE) instructions.

Do not use processor values T, P, O, W, N, B, or K to create binaries that will execute on a processor that is not compatible with the targeted processor. The resulting program may fail with an illegal instruction exception or display other unexpected behavior. For example, binaries produced with W may produce code that will not run on Intel® Pentium® III processors and earlier processors that do not support SSE2 instructions.

The binaries produced by these values will run on Intel processors that support all of the features for the targeted processor. For example, binaries produced with W will run on an Intel® Core™2 Duo processor, because that processor completely supports all of the capabilities of the Intel® Pentium® 4 processor, which W targets. Note that specifying T has the potential of using even more features and optimizations available to the Intel® Core™2 Duo processor.

Compiling the main program (in Fortran) or the function main() (in C/C++) with processor values T, N, B, or P produces binaries that display a fatal run-time error if they are executed on unsupported processors. For more information, see Optimizing Applications.

The processor values O, K, and W produce binaries that should run on non-Intel processors such as AMD processors, which implement the same capabilities as the corresponding Intel processors.

On Linux* and Windows* systems using Intel® 64 architecture, O, W, P, and T are the only valid processor values.

On Mac OS* systems using IA-32 architecture, P and T are the only valid processor values. On these systems, P is the default and is always set. On Mac OS systems using Intel® 64 architecture, T is the only valid processor value. On these systems, T is the default and is always set.

Specifying -xW sets -mtune=pentium4.

If you specify more than one processor value, code is generated for only the highest-performing processor specified. The highest-performing to lowest-performing processor values are: T, P, O, B, N, W, K.

Alternate Options

-xK Linux : -march=pentium3
Mac OS: None
Windows: None
-xW Linux : -march=pentium4
Mac OS: None
Windows: None

See Also

ax, Qax compiler options