HGPR | NOHGPR

Category

Optimization and tuning

Pragma equivalent

None.

Purpose

Enables the compiler to exploit 64-bit General Purpose Registers (GPRs) in 32-bit programs targeting z/Architecture® hardware.

When the HGPR compiler option is in effect, the compiler can exploit 64-bit GPRs in the generated code. The compiler will take advantage of this permission when the code generation condition is appropriate.

When the NOHGPR and ILP32 compiler options are in effect, the compiler cannot exploit 64-bit GPRs in the generated code.

Syntax

Read syntax diagramSkip visual syntax diagram
   .-NOHGPR-.                             
>>-+-HGPR---+--+----------------------+------------------------><
               |    .-NOPRESERVE-.    |   
               '-(--+-PRESERVE---+--)-'   

Defaults

NOHGPR

For METAL, the default is HGPR(PRESERVE).

Parameters

PRESERVE
Instructs the compiler to preserve the high halves of the 64-bit GPRs that a function is using, by saving them in the prolog for the function and restoring them in the epilog. The PRESERVE suboption is only necessary if the caller is not known to be z/OS® XL C/C++ compiler-generated code.
NOPRESERVE
Because of performance considerations, the default suboption for HGPR is NOPRESERVE.

Usage

HGPR means "High-half of 64-bit GPR", which refers to the use of native 64-bit instructions. In particular, if the application has the use of long long types, it should benefit from the native 64-bit instructions.

The HGPR compiler option requires ARCH(5) (and above).

IPA effects

The IPA compile step generates information for the IPA link step. If IPA(OBJECT) is specified, then the resulting object module will be compiled with the specified HGPR setting.

The IPA link step will accept the HGPR option, but ignores it. 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. The HGPR setting for a partition is determined by the first function that is imported into the partition. All other functions that are imported into the given partition must have the same HGPR option setting.

Predefined macros

None.