Native object files

0 Likes

This article describes which processors are supported for native code

Problem:

Not all processors are supported for native code. To increase the performance it can be necessary under certain circumstances to determine which processor will be supported and how the code can be implemented.

Resolution:

ACUCOBOL-GT supports several options that cause it to generate and execute object files that contain native instructions for select families of processors. These options may not be combined with other options into a single option. For example, it is an error to specify "-nv"; you must specify "-n -v" instead.

The compiler uses cblutil to produce the native-code object file. cblutil is installed in the same directory as the compiler by default. The compiler searches the execution path if it cannot find cblutil in its own directory.

You run a native-code object module just like a portable-code object module. You may mix native-code objects and portable-code objects in the same run. Native objects may be placed in libraries just like portable objects.

You can use the debugger with a native-code module in the same fashion as with a portable-code module. The only restriction is that you may not begin program execution at an arbitrary point in a native-code module (the "@!" command). Also, to prepare a native-code object for use with the debugger, you must compile the program with one of the debugging options, such as "-Ga" or "-Gd". A complete list of debugging options is located in section 2.2.13, "Debugging Options."

UNIX Example:

To compile and run the "tour.cbl" program as a portable-code object, use the following commands:

ccbl tour.cbl 
runcbl tour 

To compile and run the same program as a native-code object, use the following:

ccbl -n tour.cbl 
runcbl tour 

These are the ACUCOBOL-GT compiler native code options:

-n

This option causes the compiler to produce native code for the host machine (instead of processor-independent portable code). If native code generation is not supported for the host machine, the compiler generates an error.

The word-size of the native code generated with the "-n" option matches the internal word-size of the compiler, and not that of the host machine's processor. It does this because the word-size of the native code must match the internal word-size of the runtime to execute correctly. Therefore, a 32-bit compiler, even when running on a 64-bit machine, will produce 32-bit native code.

If running a program compiled with "-n" on a Windows machine that has Data Execution Protection (DEP) enabled for all processes, you need to set the runtime configuration variable USE_EXECUTABLE_MEMORY to "TRUE".

--intel or --ia-32

This option causes the compiler to produce 32-bit native code for Intel-class processors (486, Pentium, Pentium II, Pentium III, or compatible processors). You can use this option from any host machine. This is the same as specifying "-n" when the host machine is an Intel-class machine.

--pa_risc or –pa

This option causes the compiler to produce 32-bit code for PA-RISC Version 1.0 processors running the HP-UX or MPE/iX operating systems. Note that the runtime must be a 32-bit runtime, to match the code contained in the object file. The 32-bit runtime runs without modification on PA-RISC 2.0 platforms as well, providing a portable solution. You can use this option from any host machine. This is the same as specifying "-n" with a 32-bit compiler on an HP-UX or MPE/iX machine.

--pa_risc_2.0 or --pa2

This option causes the compiler to produce 64-bit code for PA-RISC Version 2.0 processors running the HP-UX operating system. Note that the runtime must be a 64-bit runtime, to match the code contained in the object file. You can use this option from any host machine. This is the same as specifying "-n" with a 64-bit compiler on an HP-UX machine.

--power

Produces code that is compatible with POWER and POWER2 processors, as well as PowerPC and later POWER series processors. This option allows you to use a wide range of machines, but it may affect performance.

--powerpc or --ppc

This option causes the compiler to produce 32-bit PowerPC native code for pSeries processors running AIX. You can use this option from any host machine. This is the same as specifying "-n" with a 32-bit compiler on a pSeries machine.

Note that you can compile native code only for machines with a POWER3 or later chip, not withPOWER2 or earlier.

--powerpc_64 or --ppc64

This option causes the compiler to produce 64-bit PowerPC native code for pSeries processors running AIX. You can use this option from any host machine. This is the same as specifying "-n" with a 64-bit compiler on a pSeries machine.

--sparc

This option causes the compiler to produce 32-bit native code for SPARC (v7 - v9) processors. You can use this option from any host machine. This is the same as specifying "-n" with a 32-bit compiler on a SPARC-based host machine.

--sparc_v9

This option causes the compiler to produce 64-bit native code for SPARC version 9 processor. You can use this option from any host machine. This is the same as specifying "-n" with a 64-bit compiler on a SPARC v9-based host machine.

Old KB# 14718
Comment List
Related
Recommended