Targeting a Processor

The Intel compiler supports specific options to help optimize performance for specific Intel processors.

The -mtune (Linux*) or /G{n} (Windows*) option generates code that is backwards compatible with Intel® processors of the same family. This means that code generated with -mtune=pentium (Linux) or /G7 (Windows) will run correctly on Pentium Pro or Pentium III processors, possibly just not quite as fast as if the code had been compiled with -mtune=pentiumpro (Linux) or /G6 (Windows). Similarly, code generated with -mtune=itanium2 or -tpp2 (Linux) or /G2 (Windows) will run correctly on Itanium processor, but possibly not quite as fast as if it had been generated using -mtune=itanium or -tpp1 (Linux) or /G1 (Windows).

Note

Mac OS*: The options listed in this topic are not supported.

Options for IA-32 and Intel® EM64T Processors

The following options optimize application performance for a specific IA-32 or Intel® EM64T processor. The resulting binaries will also run correctly on any of the processors mentioned in the table.

Windows*

Linux*

Optimizes applications for...

/G5

-mtune=pentium

-mtune=pentium-mmx

Intel® Pentium® and Pentium® with MMX™ technology processor

/G6

-mtune=pentiumpro

Intel® Pentium® Pro, Pentium® II and Pentium® III processors

/G7

-mtune=pentium4

Default. Intel® Pentium® 4 processors, Intel® Core™ Duo processors, Intel® Core™ Solo processors, Intel® Xeon® processors, Intel® Pentium® M processors, and Intel® Pentium® 4 processors with Streaming SIMD Extensions 3 (SSE3) instruction support

For more information about the options listed in the table above, see the following topic:

The example commands shown below each result in a compiled binary of the source program prog.f optimized for Pentium 4 and Intel® Xeon® processors by default. The same binary will also run on Pentium, Pentium Pro, Pentium II, Pentium III, and more advanced processors.

The following examples demonstrate using the default options to target a processor:

Platform

Example

Linux

ifort -mtune=pentium4 prog.f

Windows

ifort /G7 prog.f

Options for Itanium® Processors

The following options optimize application performance for an Itanium® processors.

Windows*

Linux*

Optimizes applications for...

/G1

-tpp1

-mtune=itanium

Intel® Itanium® processors

/G2

-tpp2

-mtune=itanium2

Default. Intel® Itanium® 2 processors

/G2-p9000

-mtune=itanium2-p9000

Dual-Core Intel® Itanium® 2 Processor 9000 Sequence processors

For more information about the options listed in the table above, see the following topic:

The following examples demonstrate using the default options to target an Itanium® 2 processor. The same binary will also run on Itanium processors.

Platform

Example

Linux

ifort -mtune=itanium2 prog.f

Windows

ifort /G2 prog.f