Intel® Compiler Options for Intel® SSE and Intel® AVX generation (SSE2, SSE3, SSSE3, ATOM_SSSE3, SSE4.1, SSE4.2, ATOM_SSE4.2, AVX, AVX2) and processor-specific optimizations

What are the IA-32 and Intel® 64 processor targeting options in the Intel® compilers?
There are three main types of processor-specific optimization options:

  1. Processor-specific options of the form /arch:<code> on Windows* ( -m<code> on Linux* or Mac OS* X) generate specialized code for processors specified by <code>. The resulting executables from these processor-specific options can be run on the specified or later Intel® and compatible, non-Intel® processors that support the instruction set. The executable may incorporate optimizations specific to those processors and use a specific version of the Intel® Streaming SIMD Extensions (SSE) instruction set and/or the Intel® Advanced Vector Extensions (AVX) instruction set; on older processors without support for the corresponding instruction set, an illegal instruction or similar error may occur.

    Where the value for <code> can be:

    AVX May generate Intel® AVX, Intel® SSE4.2, SSE4.1, SSSE3, SSE3, SSE2 and SSE instructions.
    SSE4.2 May generate Intel® SSE4.2, SSE4.1, SSSE3, SSE3, SSE2 and SSE instructions.
    SSE4.1 May generate Intel® SSE4.1, SSSE3, SSE3, SSE2 and SSE instructions.
    SSSE3 May generate SSSE3, Intel® SSE3, SSE2 and SSE instructions.
    SSE3 May generate Intel® SSE3, SSE2 and SSE instructions.
    SSE2 May generate Intel® SSE2 and SSE instructions. /arch:SSE2 is the default on Windows* and -msse2 is the default on Linux*.
    IA32 Generates generic IA-32 compatible code. Can only be used with the /arch: or -m switches. (IA-32 compiler only).

  2. Processor-specific options of the form /Qx<code> on Windows*( -x<code> on Linux* or OS X*) generate specialized code for processors specified by <code>. The resulting executables from these processor-specific options can only be run on the specified or later Intel® processors, as they incorporate optimizations specific to those processors and use a specific version of the Streaming SIMD Extensions (SSE) instruction set and/or the Intel® Advanced Vector Extensions (AVX) instruction set. This switch enables some optimizations not enabled with the corresponding switches /arch:x<code> or -m<code>. A run-time check is inserted in the resulting executable that will halt the application if run on an incompatible processor. This is intended to help you quickly find out that the program was not intended for the processor it is running on and potentially avoids an illegal instruction error. For this check to be effective, the source file containing the main program or the dynamic library main function should be compiled with this option enabled.

    Where the value for <code> can be:

    CORE-AVX2 May generate Intel® AVX2, Intel® AVX, SSE4.2, SSE4.1, SSSE3, SSE3, SSE2 and SSE instructions for Intel® processors. Optimizes for 4th generation Intel® Core™ processors. Available in compiler versions 13 and later.
    CORE-AVX-I May generate Intel® AVX, SSE4.2, SSE4.1, SSSE3, SSE3, SSE2 and SSE instructions for Intel® processors, including instructions for 3rd generation Intel® Core™ processors. Optimizes for 3rd generation Intel® Core™ processors. Available in compiler versions 12.1 and later.
    AVX May generate Intel® AVX, SSE4.2, SSE4.1, SSSE3, SSE3, SSE2 and SSE instructions for Intel® processors. Optimizes for 2nd generation Intel® Core™ i7, i5 and i3 processor families and the Intel® Xeon® Processor E5 and E3 families.
    SSE4.2 May generate Intel® SSE4.2, SSE4.1, SSSE3, SSE3, SSE2 and SSE instructions for Intel® processors. Optimizes for the previous generation Intel® Core™ i7, i5 and i3 processor families, the Intel® Xeon® 55XX, 56XX and 75XX series and the Intel® Xeon® Processor E7 Family.
    ATOM_SSE4.2 May generate Intel® SSE4.2, SSE4.1, SSSE3, SSE3, SSE2 and SSE instructions for Intel® processors. May also generate MOVBE instructions if the option /Qinstruction:movbe (-minstruction=movbe) is set. Optimizes for Intel® Atom™ processors that support Intel® SSE4.2 and MOVBE instructions.
    SSE4.1 May generate Intel® SSE4.1, SSSE3, SSE3, SSE2 and SSE instructions for Intel® processors. Optimizes for the 45nm Hi-k next generation Intel® Core™ processors.
    SSSE3 May generate Intel® SSSE3, SSE3, SSE2 and SSE instructions for Intel® processors. Optimizes for Intel® Core™ microarchitecture. -xssse3 is the default for the Intel® 64 architecture compiler on OS X*.
    ATOM_SSSE3 May generate SSSE3, Intel® SSE3, SSE2 and SSE instructions for Intel® processors. May also generate MOVBE instructions if the option /Qinstruction:movbe (-minstruction=movbe) is set. Optimizes for Intel® Atom™ processors that support SSSE3 and MOVBE instructions.
    SSE3 May generate Intel® SSE3, SSE2 and SSE instructions. Optimizes for the enhanced Intel® Pentium® M processor microarchitecture and Intel® Netburst microarchitecture. -xsse3 is the default for the IA-32 compiler on OS X*.
    SSE2 May generate Intel® SSE2 and SSE instructions. Optimizes for the Intel® Netburst microarchitecture.

  3. Processor-dispatch options of the form /Qax<code> on Windows* ( -ax<code> on Linux* or OS X*) allow the generation of multiple code paths for Intel® processors. Processor dispatch technology performs a check at execution time to determine which processor the application is running on and use the most suitable code path for that processor. Compatible, non-Intel processors will take the default optimized code path. The switches described in 1. and 2. above can be used to modify the default optimized code path.

    Where the value for <code> can be:

    CORE-AVX2 May generate Intel® AVX2, Intel® AVX, SSE4.2, SSE4.1, SSSE3, SSE3, SSE2 and SSE instructions for Intel® processors. Available in compiler versions 13 and later.
    CORE-AVX-I May generate Intel® AVX, SSE4.2, SSE4.1, SSSE3, SSE3, SSE2 and SSE instructions for Intel® processors, including instructions for 3rd generation Intel® Core™ processors. Available in compiler versions 12.1 and later.
    AVX May generate Intel® AVX, SSE4.2, SSE4.1, SSSE3, SSE3, SSE2 and SSE instructions for Intel® processors.
    SSE4.2 May generate Intel® SSE4.2, SSE4.1, SSSE3, SSE3, SSE2 and SSE instructions for Intel® processors.
    SSE4.1 May generate Intel® SSE4.1,SSSE3, SSE3, SSE2 and SSE instructions for Intel® processors.
    SSSE3 May generate Intel® SSSE3, SSE3, SSE2 and SSE instructions for Intel® processors.
    SSE3 May generate Intel® SSE3, SSE2 and SSE instructions for Intel® processors.
    SSE2 May generate Intel® SSE2 and SSE instructions for Intel® processors.

Which processor-specific option is best for my processor?

CORE-AVX2 4th Generation Intel® Core™ Processors
CORE-AVX-I 3rd Generation Intel® Core™ i7 Processors
3rd Generation Intel® Core™ i5 Processors
AVX 2nd Generation Intel® Core™ i7 Processors
2nd Generation Intel® Core™ i5 Processors
2nd Generation Intel® Core™ i3 Processors
Intel® Xeon® Processor E5 Family
Intel® Xeon® Processor E3 Family
SSE4.2 Previous Generation Intel® Core™ i7 Processors
Previous Generation Intel® Core™ i5 Processors
Previous Generation Intel® Core™ i3 Processors
Intel® Xeon® 55XX series
Intel® Xeon® 56XX series
Intel® Xeon® 75XX series
Intel® Xeon® Processor E7 Family
ATOM_SSE4.2 Intel® Atom™ processors that support Intel® SSE4.2 instructions.
SSE4.1 Intel® Xeon® 74XX series
Quad-Core Intel® Xeon 54XX, 33XX series
Dual-Core Intel® Xeon 52XX, 31XX series
Intel® Core™ 2 Extreme 9XXX series
Intel® Core™ 2 Quad 9XXX series
Intel® Core™ 2 Duo 8XXX series
Intel® Core™ 2 Duo E7200
SSSE3 Quad-Core Intel® Xeon® 73XX, 53XX, 32XX series
Dual-Core Intel® Xeon® 72XX, 53XX, 51XX, 30XX series
Intel® Core™ 2 Extreme 7XXX, 6XXX series
Intel® Core™ 2 Quad 6XXX series
Intel® Core™ 2 Duo 7XXX (except E7200), 6XXX, 5XXX, 4XXX series
Intel® Core™ 2 Solo 2XXX series
Intel® Pentium® dual-core processor E2XXX, T23XX series
ATOM_SSSE3 Intel® Atom™ processors
SSE3 Dual-Core Intel® Xeon® 70XX, 71XX, 50XX Series
Dual-Core Intel® Xeon® processor (ULV and LV) 1.66, 2.0, 2.16
Dual-Core Intel® Xeon® 2.8
Intel® Xeon® processors with SSE3 instruction set support
Intel® Core™ Duo
Intel® Core™ Solo
Intel® Pentium® dual-core processor T21XX, T20XX series
Intel® Pentium® processor Extreme Edition
Intel® Pentium® D
Intel® Pentium® 4 processors with SSE3 instruction set support
SSE2 Intel® Xeon® processors
Intel® Pentium® 4 processors
Intel® Pentium® M
IA32 Intel® Pentium® III Processor
Intel® Pentium® II Processor
Intel® Pentium® Processor

 


Which processor is targeted by default?

  • When compiling for the IA-32 architecture or the Intel® 64 architecture on Windows* or Linux*, /arch:SSE2 (Windows*) or -msse2 (Linux*) is the default. The resulting code path should run on the Intel Pentium 4 and Intel Xeon processors with SSE2 support and other later Intel processors or compatible non-Intel processors with SSE2 support.
  • When compiling for the IA-32 architecture on OS X*, -xSSE3 is the default. The compiler may generate SSE3, SSE2 and SSE instructions and the code is optimized for enhanced Pentium M processor microarchitecture.
  • When compiling for the Intel® 64 architecture on OS X* , -xSSSE3 is the default. The compiler may generate SSSE3, SSE3, SSE2 and SSE instructions and the code is optimized for the Intel® Core™ microarchitecture.

To target older IA-32 systems without support for SSE2 instructions, such as systems based on the Intel® Pentium® III Processor, use the switch /arch:ia32 (Windows*) or -mia32 (Linux*).

For information about other, older processor targeting options and their relation to the recommended options above, see
http://software.intel.com/en-us/articles/ia-32-and-intel-64-processor-targeting-overview


Other common questions
(continuation article)

 

Optimization Notice in English

For more complete information about compiler optimizations, see our Optimization Notice.

Comments

's picture

And what about -xHost option? Can we use this flag to auto-detect the best option for a host processor?

's picture

for Intel Core 2 only 45nm processors will only have SSE4.1 for 65nm only have up to SSSE3

's picture

Thank you for that,

I have probem:
error: #error "SSE instruction set not enabled"
how I can enable any option of them (-msse2,msse4.2, etc)? plz in detaled!
e
any help will be appreciated!

's picture

I am getting trouble with this error: "SSE instruction set not enabled"

how I can figure this out? I have ACER i7, Ubuntu 11.10, please any one can help me?

running:
sudo cat /proc/cpuinfo | grep flags
gives:

flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid

any help will be appreciated!

's picture

I am getting trouble with this error: "SSE instruction set not enabled"

how I can figure this out? I have ACER i7, Ubuntu 11.10, please any one can help me?

running:
sudo cat /proc/cpuinfo | grep flags
gives:

flags : fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx rdtscp lm constant_tsc arch_perfmon pebs bts xtopology nonstop_tsc aperfmperf pni pclmulqdq dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm sse4_1 sse4_2 x2apic popcnt xsave avx lahf_lm ida arat epb xsaveopt pln pts dts tpr_shadow vnmi flexpriority ept vpid

any help will be appreciated!