-mtune

Purpose

Tunes architecture-dependent performance enhancements, such as scheduling, to enable programs to run optimally on a specific hardware architecture.

Syntax

Read syntax diagramSkip visual syntax diagram  -m tune = pwr7power7nativepowerpcpowerpc64ppcppc64pwr8power8pwr9power9pwr10power10

Defaults

-mtune=power7 or -mtune=pwr7 when no valid -mcpu setting is in effect. Otherwise, the default value depends on the -mcpu setting. Find details in Table1: Acceptable -mcpu and -mtune combinations.

Parameters

The following suboptions allow you to specify a particular architecture for the compiler to target for best performance:

native
Optimizations are tuned for the platform on which the application is compiled.
powerpc|ppc
Optimizations are tuned for the 32-bit PowerPC® hardware platforms.
powerpc64|ppc64
Optimizations are tuned for the 64-bit PowerPC hardware platforms.
power7|pwr7
Optimizations are tuned for the Power7 or Power7+ hardware platforms.
power8|pwr8
Optimizations are tuned for the Power8 hardware platform.
power9|pwr9
Optimizations are tuned for the Power9 hardware platform.
power10|pwr10
Optimizations are tuned for the Power10 hardware platform.

Usage

Use a combination of the -mcpu and -mtune options when you want your program to run on more than one architecture but be tuned for a particular architecture.

The -mtune option can improve performance by arranging (scheduling) the generated machine instructions to take maximum advantage of hardware features, such as cache size and pipelining.

Although changing the -mtune setting might impact the performance of the resulting executable, it does not affect whether the executable can be executed correctly on a particular hardware platform.

You can find the acceptable combinations of -mcpu and -mtune in the following table.
Table 1. Acceptable -mcpu and -mtune combinations
The -mcpu option Default -mtune setting Available -mtune settings
native native native and hardware platforms newer than the compilation environment
powerpc | ppc ppc native | ppc | ppc64 | pwr7 | pwr8 | pwr9 | pwr10
powerpc64 | ppc64 ppc64 native | ppc64 | pwr7 | pwr8 | pwr9 | pwr10
pwr7 pwr7 native | pwr7 | pwr8 | pwr9 | pwr10
pwr8 pwr8 native | pwr8 | pwr9 | pwr10
pwr9 pwr9 native | pwr9 | pwr10
pwr10 pwr10 native | pwr10
Note: You can set -mtune to native when the compilation environment is same as or newer than the environment specified by -mcpu.

Predefined macros

None.

Examples

To tune the executable program testing compiled from myprogram.c for a Power10 hardware platform, enter:
ibm-clang -o testing myprogram.c -mtune=pwr10

Related information