[an error occurred while processing this directive]

HP OpenVMS Systems Documentation

Content starts here

HP COBOL
User Manual


Previous Contents Index


REFORMAT - Error in reading (ANSI or terminal) format input file
REFORMAT - Reformating aborted
REFORMAT - n (ANSI or terminal) COBOL  source records converted to
                 (ANSI or terminal) format
REFORMAT - ANSI-to-terminal format conversion mode [ Y or N ]?

REFORMAT failed to read a record from the input file. This error ends the conversion process. REFORMAT closes both files and displays the number of converted input records.

You can convert another file, or you can end the session by typing Ctrl/Z (on OpenVMS systems) or CTRL/D (on Tru64 UNIX systems).


REFORMAT - Error in writing (ANSI or terminal) format output file
REFORMAT - Reformatting aborted
REFORMAT - n (ANSI or terminal) COBOL source records converted to
                 (ANSI or terminal) format
REFORMAT - ANSI-to-terminal format conversion mode [ Y or N ]?

REFORMAT failed in an attempt to write an output record. It ends execution and closes both files.

To process another file, type a new input file specification and continue the prompting message sequence. To end execution, type Ctrl/Z (on OpenVMS systems) or CTRL/D (on Tru64 UNIX systems).


Chapter 15
Optimizing Your HP COBOL Program

You can specify optimization and data alignment on the COBOL compiler command line to improve run-time performance. You can also decrease processing time and save storage space by writing programs that take advantage of compiler optimizations.

The information that you find here contains guidelines only, not rules. Follow those suggestions that fit your needs.

This chapter provides the following information about optimizing your HP COBOL programs on the OpenVMS and Tru64 UNIX operating systems:

15.1 Specifying Optimization on the Compiler Command Line (Alpha, I64)

The HP COBOL compiler is a highly optimizing compiler. Full optimization is the default with the COBOL compiler command and usually results in improved run-time performance. You can specify the desired level of optimization by adding a value to the optimize option. The various formats are provided here to illustrate the similarity in processes across the supported platforms.

On Alpha and I64 systems, the /OPTIMIZE qualifier has the following forms:


/OPTIMIZE[=LEVEL=n]


/OPTIMIZE=TUNE=keyword

or


/NOOPTIMIZE <>

On Tru64 UNIX systems, the -O flag and the -tune flag specify optimization. The -O flag has the following form:


-On

The -tune flag has the following form:


-tune keyword <>

The -tune flag is the equivalent of the /OPTIMIZE=TUNE qualifier.

/OPTIMIZE=LEVEL is the same on OpenVMS Alpha, OpenVMS I64, and Tru64 UNIX systems. n is a number ranging from 0 to 4, specifying the level of optimization. In brief, these levels mean the following:

  • Level 0---Has the same effect as /NOOPTIMIZE. All optimizations are turned off, and the compiler does not check for unassigned variables.
  • Level 1---Enables local optimizations, including instruction scheduling and recognition of common subexpressions.
  • Level 2---Enables all level 1 optimizations, and adds some global optimizations (such as split lifetime analysis, code motion, strength reduction and test replacement, and code scheduling).
  • Level 3---Enables all level 2 optimizations, and adds more global optimizations (such as decimal shadowing, integer multiplication and division expansion, using shifts, loop unrolling, and code replication to eliminate branches). All optimizations are turned on.
  • Level 4---Is identical to level 3 for COBOL. This is the default if you specify optimize with no value, or if you compile without specifying any form of the optimize option on the command line.

/OPTIMIZE=TUNE=keyword (or -tune keyword specifies the kind of optimized code to be generated, allowing you to tune optimization to the specific Alpha hardware. The keyword can be any of the following:

  • GENERIC---Generates and schedules code that will execute well for both generations (EV4 and EV5 and later) of Alpha processors. This is the default.
    This provides generally efficient code for those cases where both processor generations are likely to be used.
  • HOST---Generates and schedules code optimized for the processor generation in use on the system being used for compilation.
  • EV4---Generates and schedules code optimized for the 21064, 21064A, 21066, and 21068 implementations of the Alpha chip.
  • EV5---Generates and schedules code optimized for the 21164 implementation of the Alpha chip. This processor generation is faster than EV4.
  • EV56---Generates code for some 21164 chip implementations that use the byte and word manipulation instruction extensions of the Alpha architecture.
    Programs compiled with the EV56 keyword might incur run-time emulation overhead on EV4 and EV5 processors, but will still run correctly on OpenVMS Version 7.1 (or later) systems.
  • EV6---Generates and schedules code for the 21264 chip implementation that uses the following extensions to the base Alpha instruction set: BWX (Byte/Word manipulation) and MAX (Multimedia) instructions, square root and FIX (Floating-point convert) instructions.
  • EV67---Generates and schedules code for the 21264A chip implementation that uses the following extensions to the base Alpha instruction set: BWX (Byte/Word manipulation) and MAX (Multimedia) instructions, square root and FIX (Floating-point convert) instructions, and CIX (Count) instructions.
  • EV68---Generates and schedules code that uses the following extensions to the base Alpha instruction set: BWX (Byte/Word manipulation) and MAX (Multimedia) instructions, square root and FIX (Floating-point convert) instructions, and CIX (Count) instructions.
  • PCA56---Generates code for the 21164PC chip implementation that uses the byte and word manipulation instruction extensions and multimedia instruction extensions of the Alpha architecture.
    Programs compiled with the PCA56 keyword might incur run-time emulation overhead on EV4, EV5, and EV56 processors, but will still run correctly on OpenVMS Version 7.1 (or later) systems.
  • The /OPTIMIZE=TUNE qualifier is currently ignored on OpenVMS I64.

/ARCHITECTURE Qualifier

The /ARCHITECTURE= option qualifier (or -arch option on Tru64 UNIX) determines the type of Alpha chip code that will be generated for a particular program.

The /ARCHITECTURE qualifier uses the same options (keywords) as the /OPTIMIZE=TUNE qualifier, and their definitions are similar. However, their effects are not identical. The /OPTIMIZE=TUNE qualifier is primarily used by certain higher-level optimizations for instruction scheduling purposes, while the /ARCHITECTURE qualifier determines the type of code instructions generated for the program unit being compiled.

OpenVMS Version 7.1 and subsequent releases provide an operating system kernel that includes an instruction emulator. This emulator allows new instructions, not implemented on the host processor chip, to execute and produce correct results. All Alpha processors implement a core set of instructions. Certain Alpha processor versions include additional instruction extensions. Applications using emulated instructions will run correctly, but might incur significant software emulation overhead at run time.

The following /ARCHITECTURE options are supported:

  • GENERIC---Generates code that is appropriate for all Alpha processor generations. This is the default.
    Programs compiled with the GENERIC option run all implementations of the Alpha architecture without any instruction emulation overhead.
  • HOST---Generates code for the processor generation in use on the system being used for compilation.
    Programs compiled with this option on other implementations of the Alpha architecture may encounter instruction emulation overhead.
  • EV4---Generates code for the 21064, 21064A, 21066, and 21068 implementations of the Alpha architecture.
    Programs compiled with the EV4 option run without instruction emulation overhead on all Alpha processors.
  • EV5---Generates code for some 21164 chip implementations of the Alpha architecture that use only the base set of Alpha instructions (no extensions).
    Programs compiled with the EV5 option run without instruction emulation overhead on all Alpha processors.
  • EV56---Generates code for some 21164 chip implementations that use the byte and word manipulation instruction extensions of the Alpha architecture.
    Programs compiled with the EV56 option may incur emulation overhead on EV4 and EV5 processors, but will still run correctly on OpenVMS Version 7.1 (or later) systems.
  • EV6---Generates code for the 21264 chip implementation that uses the following extensions to the base Alpha instruction set: BWX (Byte/Word manipulation) and MAX (Multimedia) instructions, square root and FIX (Floating-point convert) instructions.
    Programs compiled with the EV6 option may incur emulation overhead on EV4, EV5, EV56, and PCA56 processors, but will still run correctly on OpenVMS Version 7.1 (or later) systems.
  • EV67---Generates code for the 21264A chip implementation that uses the following extensions to the base Alpha instruction set: BWX (Byte/Word manipulation) and MAX (Multimedia) instructions, square root and FIX (Floating-point convert) instructions, and CIX (Count) instructions.
    Programs compiled with the EV67 option may incur emulation overhead on EV4, EV5, EV56, EV6, and PCA56 processors, but will still run correctly on OpenVMS Version 7.1 (or later) systems.
  • EV68---Generates code that uses the following extensions to the base Alpha instruction set: BWX (Byte/Word manipulation) and MAX (Multimedia) instructions, square root and FIX (Floating-point convert) instructions, and CIX (Count) instructions.
    Programs compiled with the EV68 option may incur emulation overhead on EV4, EV5, EV56, EV6, EV7, and PCA56 processors, but will still run correctly on OpenVMS Version 7.1 (or later) systems.
  • PCA56---Generates code for the 21164PC chip implementation that uses the byte and word manipulation instruction extensions and multimedia instruction extensions of the Alpha architecture.
    Programs compiled with the PCA56 option may incur emulation overhead on EV4, EV5, and EV56 processors, but still run correctly on OpenVMS Version 7.1 (or later) systems.
  • The /ARCHITECTURE qualifier is currently ignored on OpenVMS I64.

Note

If a program contains declarations of non-EXTERNAL variables that are not referenced in the program, the HP COBOL compiler does not allocate those variables. These variables are not affected by /OPTIMIZE; they simply are not allocated. This feature improves both resource usage and run-time performance, and allows the use of site "copybooks" that have numerous standardized variables. Only those copybook variables that are referenced will be allocated within a given program.


Previous Next Contents Index