Targeting IA-32 Architecture Processors Automatically

The -x (Linux* and Mac OS*) or /Qx (Windows*) options optimize your application for specific Intel® processors.

If you intend to run your programs on multiple processors based on IA-32 or Intel® 64 architectures, do not use this option; instead, consider using the -ax (Linux and Mac OS) or /Qax (Windows) option to achieve both processor-specific performance and portability among different processors.

The optimizations can include generating Supplemental Streaming SIMD Extensions 3 (SSSE3), Streaming SIMD Extensions 3 (SSE3), Streaming SIMD Extensions 2 (SSE2), or Streaming SIMD Extensions (SSE) instructions; therefore, using these options effectively sets a minimum architecture level your code will support for specific processors based on IA-32 and Intel® 64 architectures.

The targeted optimization allow you to take advantage of the architectural differences, new instruction sets, or advances in processor design; however, the resulting, optimized code might contain unconditional use of features that are not supported on other, earlier processors.  Other optimizations take effect at run-time.

Linux and Mac OS

Windows

Description

-xT

/QxT

Can generate SSSE3, SSE3, SSE2 and SSE instructions and can optimize code for the following:

  • Intel® Core™2 Quad processors

  • Quad-Core Intel® Xeon® processors

  • Intel® Xeon® processors based on the Intel® Core™ microarchitecture

  • Intel® Core™2 Duo processors

  • Intel® Core™2 Extreme processors

  • Intel processors based on the Intel® Core™ microarchitecture

Mac OS: This is a supported value.

-xP

/QxP

Can generate SSE3, SSE2 and SSE instructions and can optimize code for the following:

  • Intel® Core™ Duo processors

  • Intel® Core™ Solo processors

  • Pentium® D processors

  • Intel Pentium® 4 processors

  • Intel Celeron® M processors

  • Intel Celeron® D processors

  • Intel® Xeon® processors with SSE3 instruction set support.

  • Intel processors based on Intel® Core™ microarchitecture or Intel® NetBurst microarchitecture

Mac OS: This is a supported value.

-xO

/QxO

Can generate SSE3, SSE2, and SSE instructions and can optimize code for processors based on the Intel® Core™ microarchitecture.

The generated code should run on any processor that supports SSE3, SSE2, and SSE instruction sets, including those not designed by Intel Corporation.

This value does not enable some optimizations enabled when using P or T.

-xW

/QxW

Can generate SSE2 and SSE instructions and can optimize code for the Intel Pentium® 4 processor, and Intel® Xeon® processors with SSE2.

This is the default value for Intel® 64 architecture systems.

-xN

/QxN

Can generate SSE2 and SSE instructions for Intel processors and can optimize code for the Pentium® 4 processor, and Intel® Xeon® processors with SSE2.

-xB

/QxB

Can generate SSE2 and SSE instructions for Intel processors and can optimize code for Intel® Pentium® M processors.

This value is deprecated. Use N or W instead.

-xK

/QxK

Can generate SSE instructions for Intel processors and can optimize code for Intel® Pentium® III and Intel Pentium® III Xeon® processors.

The O, W, and K processor values can produce binaries capable of running on processors that support instruction sets and features of Intel processor but are not made by Intel.

To prevent execution errors, the compiler inserts code in the main routine of the program to check for proper processor usage. Using this option limits you to a minimum processor level. For example, if you target an application to run on Intel® Xeon® processors based on the Intel® Core™ microarchitecture it is unlikely the resulting application will operate correctly on earlier Intel processors. If you target a processor and run the compiled executable on a system without the targeted processor, the application might fail with an illegal instruction exception or display other unexpected behavior.

If you target more than one processor value, the resulting code will be generated for the highest-performing processor specified if the compiler determines there is an advantage in doing so. The highest- to lowest-performing processor values are as follows:

  1. T

  2. P

  3. O

  4. B

  5. N

  6. W

  7. K

Executing programs compiled with processor values of N, B, P, or T on unsupported processors will display a run-time error. For example, if you use T to compile an application but execute the application on an Intel® Pentium® 4 processor, the application generates an error similar to the following:

Run-time Error

Fatal Error: This program was not built to run on the processor in your system.

The allowed processors are: Intel(R) Core(TM) Duo processors and compatible Intel processors with supplemental Streaming SIMD Extensions 3 (SSSE3) instruction support.
 

The following examples compile an application for Intel® Core™2 Duo processor and compatible processors. The resulting binary might not execute correctly on earlier processors or on IA-32 processors not designed by Intel Corporation.

Platform

Example

Linux and Mac OS

icpc -xT sample.cpp

Windows

icl /QxT sample.cpp

For more specific architecture support information, the following compiler option: