The -x (Linux* and Mac OS* X) or /Qx (Windows*) option can automatically optimize your application for specific Intel® processors based on IA-32 and Intel® 64 architectures.
The automatic optimizations 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. Therefore, using these options effectively sets a minimum hardware requirement for your application.
The optimizations can include generating Intel® Streaming SIMD Extensions 4 (SSE4), Supplemental Streaming SIMD Extensions 3 (SSSE3), Streaming SIMD Extensions 3 (SSE3), Streaming SIMD Extensions 2 (SSE2), or Streaming SIMD Extensions (SSE) instructions.
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 X) or /Qax (Windows) option to achieve both processor-specific performance gains and portability among different processors.
Linux OS and Mac OS X |
Windows OS |
Description |
---|---|---|
Can generate instructions for the highest instruction set and processor available on the compilation host. |
||
Optimizes for Intel processors that support Intel® Advanced Vector Extensions (Intel® AVX). |
||
Can generate Intel® SSE4 Vectorizing Compiler and Media Accelerator instructions for Intel processors. Can generate Intel® SSSE3, SSE3, SSE2, and SSE instructions and it can optimize for Intel® 45nm Hi-k next generation Intel® Core™ microarchitecture. This replaces value S, which is deprecated. |
||
Can generate Intel® SSE4 Efficient Accelerated String and Text Processing instructions supported by Intel® Core™ i7 processors. Can generate Intel® SSE4 Vectorizing Compiler and Media Accelerator, Intel® SSSE3, SSE3, SSE2, and SSE instructions and it can optimize for the Intel® Core™ processor family. |
||
Can generate Intel® SSSE3, SSE3, SSE2, and SSE instructions for Intel processors and it can optimize for the Intel® Core™2 Duo processor family. This replaces value T, which is deprecated. |
||
Optimizes for the Intel® Atom™ processor and Intel® Centrino® Atom™ Processor Technology. Can generate MOVBE instructions, depending on the setting of option -minstruction (Linux and Mac OS) or /Qinstruction (Windows). Mac OS X: Supported on IA-32 architectures. |
||
Can generate Intel® SSE3, SSE2, and SSE instructions for Intel processors and it can optimize for processors based on Intel® Core™ microarchitecture and Intel NetBurst® microarchitecture. This replaces value P, which is deprecated. Mac OS X: Supported on IA-32 architectures. |
||
Can generate Intel® SSE2 and SSE instructions for Intel processors, and it can optimize for Intel® Pentium® 4 processors, Intel® Pentium® M processors, and Intel® Xeon® processors with Intel® SSE2. Mac OS X: Not supported. |
Certain keywords for compiler options -m and /arch produce binaries that should run on processors not made by Intel that implement the same capabilities as the corresponding Intel processors. For details, see Compiler Options.
To prevent illegal instruction and similar unexpected run-time errors during program execution, 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 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:
SSE4.1
SSSE3
SSE3
SSE2
Executing programs compiled with processor values of SSE4.1, SSSE3, SSE3, or SSE2 on unsupported processors will display a run-time error. For example, if you specify the SSSE3 processor value 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 demonstrate compiling 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 architecture processors not made by Intel Corporation.
Operating System |
Example |
---|---|
Linux and Mac OS X |
icpc -xSSSE3 sample.cpp |
Windows |
icl /QxSSSE3 sample.cpp |