TUNE

Category

Optimization and tuning

Pragma equivalent

#pragma options(tune) (C only)

Purpose

Tunes instruction selection, scheduling, and other implementation-dependent performance enhancements for a specific implementation of a hardware architecture.

Syntax

Read syntax diagramSkip visual syntax diagram
>>-TUN--(--n--)------------------------------------------------><

Defaults

Start of changeTUNE(8)End of change

Parameters

n
Specifies the group to which a model number belongs as a sub-parameter. If you specify a model which does not exist or is not supported, a warning message is issued stating that the suboption is invalid and that the default will be used. Current® models that are supported include:
0
This option generates code that is executable on all models, but it will not be able to take advantage of architectural differences on the models specified in the following information.
1
This option generates code that is executable on all models but that is optimized for the following models:
  • 9021-520, 9021-640, 9021-660, 9021-740, 9021-820, 9021-860, and 9021-900
  • 9021-xx1, 9021-xx2, and 9672-Rx2 (G1)
2
This option generates code that is executable on all models but that is optimized for the following models:
  • 9672-Rx3 (G2), 9672-Rx4 (G3), and 2003
  • 9672-Rx1, 9672-Exx, and 9672-Pxx
3
This option generates code that is executable on all models but that is optimized for the following and follow-on models: 9672-Rx5 (G4), 9672-xx6 (G5), and 9672-xx7 (G6).
4
This option generates code that is executable on all models but that is optimized for the model 2064-100 (z900).
5
This option generates code that is executable on all models but that is optimized for the model 2064-100 (z900) in z/Architecture® mode.
6
This option generates code that is executable on all models, but is optimized for the 2084-xxx (z990) models.
7
This option generates code that is executable on all models, but is optimized for the 2094-xxx (IBM® System z9® EC) and 2096-xxx (IBM System z9 BC) models.
8
Start of changeThis option is the default. This option generates code that is executable on all models, but is optimized for the 2097-xxx (IBM System z10® EC) and 2098-xxx (IBM System z10 BC) models.End of change
9
This option generates code that is executable on all models, but is optimized for the 2817-xxx (IBM zEnterprise® 196 (z196)) and 2818-xxx (IBM zEnterprise 114 (z114)) models.
10
This option generates code that is executable on all models, but is optimized for the 2827-xxx (IBM zEnterprise EC12 (zEC12)) and 2828-xxx (IBM zEnterprise BC12 (zBC12)) models.
11
This option generates code that is executable on all models, but is optimized for the 2964-xxx (IBM z Systems™ z13™ (z13)) models.
Note: For these system machine models, x indicates any value. For example, 9672-Rx4 means 9672-RA4 through to 9672-RY4 and 9672-R14 through to 9672-R94 (the entire range of G3 processors), not just 9672-RX4.

Usage

The TUNE option specifies the architecture for which the executable program will be optimized. The TUNE level controls how the compiler selects and orders the available machine instructions, while staying within the restrictions of the ARCH level in effect. It does so in order to provide the highest performance possible on the given TUNE architecture from those that are allowed in the generated code. It also controls instruction scheduling (the order in which instructions are generated to perform a particular operation). Note that TUNE impacts performance only; it does not impact the processor model on which you will be able to run your application.

Select TUNE to match the architecture of the machine where your application will run most often. Use TUNE in cooperation with ARCH. TUNE must always be greater or equal to ARCH because you will want to tune an application for a machine on which it can run. The compiler enforces this by adjusting TUNE up rather than ARCH down. TUNE does not specify where an application can run. It is primarily an optimization option. For many models, the best TUNE level is not the best ARCH level. For example, the correct choices for model 9672-Rx5 (G4) are ARCH(2) and TUNE(3). For more information on the interaction between TUNE and ARCH see ARCHITECTURE.
Note: If the TUNE level is lower than the specified ARCH level, the compiler forces TUNE to match the ARCH level or uses the default TUNE level, whichever is greater.

A comment that indicates the level of the TUNE option will be generated in your object module to aid you in diagnosing your program.

IPA effects

If you specify the TUNE option for any compilation unit in the IPA compile step, the compiler saves information for the IPA link step. This option also affects the regular object module if you request one by specifying the IPA(OBJECT) option.

The IPA link step merges and optimizes the application code, and then divides it into sections for code generation. Each of these sections is a partition.

If you specify the TUNE option for the IPA link step, it uses the value of the option you specify. The value you specify appears in the IPA link step Prolog listing section and all Partition Map listing sections.

If you do not specify the option on the IPA link step, the value it uses for a partition depends upon the TUNE option you specified during the IPA compile step for any compilation unit that provided code for that partition. If you specified the same TUNE value for all compilation units, the IPA link step uses that value. If you specified different TUNE values, the IPA link step uses the highest value of TUNE.

If the resulting level of TUNE is lower than the level of ARCH, TUNE is set to the level of ARCH.

The Partition Map section of the IPA link step listing, and the object module display the final option value for each partition. If you override this option on the IPA link step, the Prolog section of the IPA link step listing displays the value of the option.

The Compiler Options Map section of the IPA link step listing displays the value of the TUNE option that you specified on the IPA compile step for each object file.

Predefined macros

__TUNE__ is predefined to the value specified by the TUNE compiler option.