ARCHITECTURE

Category

Optimization and tuning

Pragma equivalent

#pragma options (architecture) (C only)

Purpose

Specifies the machine architecture for which the executable program instructions are to be generated.

Syntax

Read syntax diagramSkip visual syntax diagramARCH(n)

Defaults

ARCH(10)

Parameters

n
Specifies the group to which a model number belongs.
The following groups of models are supported:
0
Produces code that is executable on all models.
1
Produces code that uses instructions available on the following system machine models:
  • 9021-520, 9021-640, 9021-660, 9021-740, 9021-820, 9021-860, and 9021-900
  • 9021-xx1 and 9021-xx2
  • 9672-Rx1, 9672-Rx2 (G1), 9672-Exx, and 9672-Pxx

Specifically, these ARCH(1) machines and their follow-ons add the C Logical String Assist hardware instructions. These instructions are exploited by the compiler, when practical, for a faster and more compact implementation of some functions, for example, strcmp().

2
Produces code that uses instructions available on the following system machine models:
  • 9672-Rx3 (G2), 9672-Rx4 (G3), 9672-Rx5 (G4), and 2003

Specifically, these ARCH(2) machines and their follow-ons add the Branch Relative instruction (Branch Relative and Save - BRAS), and the halfword Immediate instruction set (for example, Add Halfword Immediate - AHI) which may be exploited by the compiler for faster processing.

3
Produces code that uses instructions available on the 9672-xx6 (G5), 9672-xx7 (G6), and follow-on models.

Specifically, these ARCH(3) machines and their follow-ons add a set of facilities for IEEE floating-point representation, as well as 12 additional floating-point registers and some new floating-point support instructions that may be exploited by the compiler.

Note that ARCH(3) is required for execution of a program that specifies the FLOAT(IEEE) compiler option. However, if the program is executed on a physical processor that does not actually provide these ARCH(3) facilities, any program check (operation or specification exception), resulting from an attempt to use features associated with IEEE floating point or the additional floating point registers, will be intercepted by the underlying operating system, and simulated by software. There will be a significant performance degradation for the simulation.

4
Produces code that uses instructions available on the 2064-xxx (z900) and 2066-xxx (z800) models in ESA/390 mode.

Specifically, the following instructions are used for long long operations:

  • 32-bit Add-With-Carry (ALC, ALCR) for long long addition (rather than requiring a branch sequence)
  • 32-bit Subtract-With-Borrow (SLB, SLBR) for long long subtraction (rather than requiring a branch sequence)
  • Inline sequence with 32-bit Multiply-Logical (ML, MLR) for long long multiplication (rather than calling @@MULI64)
5
Produces code that uses instructions available on the 2064-xxx (z900) and 2066-xxx (z800) models in z/Architecture® mode.

Specifically, ARCH(5) is the minimum requirement for execution of a program in 64-bit mode. If you explicitly set ARCH to a lower level, the compiler will issue a warning message and ignore your setting. ARCH(5) specifies the target machine architecture and the application can be either 31-bit or 64-bit.

6
Produces code that uses instructions available on the 2084-xxx (z990) and 2086-xxx (z890) models in z/Architecture mode.

Specifically, these ARCH(6) machines and their follow-ons add the long-displacement facility. For further information on the long-displacement facility, refer to z/Architecture Principles of Operation.

7
Produces code that uses instructions available on the 2094-xxx (IBM® System z9® Enterprise Class) and 2096-xxx (IBM System z9 Business Class) models in z/Architecture mode.

Specifically, these ARCH(7) machines and their follow-ons add instructions supported by the extended-immediate facility, which may be exploited by the compiler. Also, these machines add instructions supported by the decimal floating-point facility, which are generated if the DFP compiler option is specified and there are decimal floating-point data types in the source code. For further information on these facilities, refer to z/Architecture Principles of Operation.

8
Produces code that uses instructions available on the 2097-xxx (IBM System z10® Enterprise Class) and 2098-xxx (IBM System z10 Business Class) models in z/Architecture mode.

Specifically, these ARCH(8) machines and their follow-ons add instructions supported by the general instruction extensions facility, which may be exploited by the compiler. Also, these machines improve the performance of instructions that are supported by the decimal floating-point facility, which are generated if the DFP compiler option is specified and there are decimal floating-point data types in the source code. For further information on these facilities, refer to z/Architecture Principles of Operation.

9
Produces code that uses instructions available on the 2817-xxx (IBM zEnterprise® 196 (z196)) and 2818-xxx (IBM zEnterprise 114 (z114)) models in z/Architecture mode.

Specifically, these ARCH(9) machines and their follow-ons add instructions supported by the high-word facility, the interlocked-access facility, the load/store-on-condition facility, the distinct-operands-facility and the population-count facility. For further information about these facilities, see z/Architecture Principles of Operation.

10
Is the default value. Produces code that uses instructions available on the 2827-xxx (IBM zEnterprise EC12 (zEC12)) and 2828-xxx (IBM zEnterprise BC12 (zBC12)) models in z/Architecture mode.

Specifically, these ARCH(10) machines and their follow-ons add instructions supported by the execution-hint facility, the load-and-trap facility, the miscellaneous-instruction-extension facility, and the transactional-execution facility. For further information about these facilities, see z/Architecture Principles of Operation.

11
Produces code that uses instructions available on the 2964-xxx (IBM z13® (z13)) and the 2965-xxx (IBM z13s (z13s®)) models in z/Architecture mode.

Specifically, these ARCH(11) machines and their follow-ons add instructions supported by the vector facility, the decimal floating point packed conversion facility, and the load/store-on-condition facility 2. The VECTOR option is required for the compiler to use the vector facility. For further information about these facilities, see z/Architecture Principles of Operation.

12
Produces code that uses instructions available on the 3906-xxx (IBM z14) Start of changeand the 3907-xxx (IBM z14 Model ZR1)End of change models in z/Architecture mode.

Specifically, these ARCH(12) machines and their follow-ons add instructions supported by the vector enhancement facility 1, the vector packed decimal facility, and the miscellaneous instruction extension facility 2. The VECTOR option is required for the compiler to use the vector enhancement facility 1 and vector packed decimal facility. For further information about these facilities, see z/Architecture Principles of Operation.

Start of change13End of change
Start of changeProduces code that uses instructions available on the 8561-xxx (IBM z15) models in z/Architecture mode.

Specifically, these ARCH(13) machines and their follow-ons add instructions supported by the vector enhancement facility 2, vector packed decimal enhancement facility, and the miscellaneous instruction extensions facility 3. For further information about these facilities, see z/Architecture Principles of Operation.

End of change

Usage

When ARCHITECTURE is in effect, the compiler selects the instruction set available during the code generation of your program based on the specified machine architecture.

Specifying a higher ARCH level generates code that uses newer and faster instructions instead of the sequences of common instructions.
Notes:
  1. Your application will not run on a lower architecture processor than what you specified using the ARCH option. Use the ARCH level that matches the lowest machine architecture where your program will run.
  2. Code that is compiled at ARCH(1) runs on machines in the ARCH(1) group and later machines, including those in the ARCH(2) and ARCH(3) groups. It may not run on earlier machines. Code that is compiled at ARCH(2) may not run on ARCH(1) or earlier machines. Code that is compiled at ARCH(3) may not run on ARCH(2) or earlier machines.
  3. For the system machine models, x indicates any value. For example, 9672-Rx4 means 9672-RA4 through to 9672-RX4, not just 9672-RX4.

If you specify a group that does not exist or is not supported, the compiler uses the default, and issues a warning message.

The usage status of this option is inserted in the object file to aid you in diagnosing a problem with your program.

IPA effects

If you specify the ARCHITECTURE option for any compilation unit in the IPA compile step, the compiler generates 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 ARCH option on the IPA link step, it uses the value of that option for all partitions. The IPA link step Prolog and all Partition Map sections of the IPA link step listing display that value.

If you do not specify the option on the IPA link step, the value used for a partition depends on the value that you specified for the IPA compile step for each compilation unit that provided code for that partition. If you specified the same value for each compilation unit, the IPA link step uses that value. If you specified different values, the IPA link step uses the lowest level of ARCH.

The level of ARCH for a partition determines the level of TUNE for the partition.

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 option value that you specified for each IPA object file during the IPA compile step.

Predefined macros

__ARCH__ is predefined to the integer value of the ARCH compiler option.

Related information

  • Use the ARCH option with the TUNE option. For more information about the interaction between ARCH and TUNE, see TUNE.
  • VECTOR | NOVECTOR