COBOL - Group home

Exploiting z/Architecture HGPRs with COBOL

  

Enterprise COBOL V5 provides increased exploitation of the latest z/Architecture processors, as well as new levels of optimization, to improve the performance of z/OS COBOL applications.

To that effect, several new compiler options are introduced in V5, including AFP, ARCH, HGPR, OPTIMIZE, and STGOPT. Some were mentioned in previous blogs and now we want to bring the HGPR option in.

 

The HGPR option controls the compiler usage of the 64-bit registers provided by z/Architecture processors, and its syntax is as follows:

with the PRESERVE as the default option.

 

The Enterprise COBOL compiler exploits the full 64-bit width of the z/Architecture General Purpose Registers (GPRs). HGPR stands for "High-halves of 64-bit GPRs", which refers to the use of native 64-bit instructions.

  • HGPR(PRESERVE) instructs the compiler to preserve the high halves of the 64-bit GPRs that a program is using, by saving them in the prolog for the function and restoring them in the epilog. The PRESERVE suboption is necessary if the caller of the program is not known to be Enterprise COBOL, Enterprise PL/I, or z/OS XL C/C++ compiler-generated code.
  • HGPR(NOPRESERVE) lets the compiler omit preserving the high-halves of the 64-bit GPRs that a program is using, which can improve performance.