Processor-specific Optimization (IA-32 only)

The -x{M|i|K|W} options target your program to run on a specific IA-32 processor by specifying the minimum set of processor instructions required for the processor that executes your program. The resulting code can contain unconditional use of the specified processor instructions. The Intel® C++ Compiler includes gcc*-compatible versions of the -x{i|M|K|W} options. These options are listed in the "gcc Version" column.

Option gcc* Version Specific Optimization for...
-xM -march=pentiumii Intel® Pentium® processors with MMX(TM) technology
-xi -march=pentiumpro Intel Pentium Pro and Intel Pentium II processors
-xK -march=pentiumiii Intel Pentium III processors
-xW -march=pentium4 Intel Pentium 4 processors, Intel® Xeon(TM) processors, and Intel® Pentium® M processors

To execute the program on x86 processors not provided by Intel Corporation, do not specify the -x{M|i|K|W} option.

Example

The invocation below compiles prog.c for processors that support the K set of instructions. The optimized binary will require a Pentium III, Pentium 4, Intel Xeon processor, or Intel Pentium M processor to execute correctly. The resulting binary may not execute correctly on a Pentium, Pentium Pro, Pentium II, Pentium with MMX technology processors, or on x86 processors not provided by Intel Corporation.

prompt> icc -xK prog.c

Caution
If a program compiled with -x{M|i|K|W} is executed on a processor that lacks the specified set of instructions, it can fail with an illegal instruction exception, or display other unexpected behavior.