HPlogo HP-UX/HP C Compiler: HP C/HP-UX Reference Manual > Chapter 9 Compiling and Running HP C Programs

Compiling for Different Versions of the PA-RISC Architecture

» 

Technical documentation

Complete book in PDF

 » Table of Contents

This section discusses the use of the +DA and +DS options in more detail.

Using +DA to Generate Code for a Specific Version of PA-RISC

By default, compiling on different HP 9000 systems produces code for the architecture of the system on which the compilation is performed. Use the +DA option to change this default behavior.

The +DA option specifies which PA-RISC instruction set the compiler should use when generating code. Specifying +DAportable ensures your code will run on HP PA-RISC 2.0 and 1.1 systems, although the performance of your program may not be as good as it could be if optimized for a specific system. Specifying +DA1.1 may give better performance on PA-RISC 1.1 systems, but the executable file generated with this option will not run on PA-RISC 1.0 systems. Specifying +DA2.0 gives optimal performance on PA-RISC 2.0 systems, but the program will not run on the earlier PA-RISC architectures.

Use the command uname -m to determine the model number of your system.

When you use the +DA option depends on your particular circumstance.

  • If you plan to run your program on the same system where you are compiling, you don"t need to use +DA.

  • If you plan to run your program on one particular model of the HP 9000 and that model is different from the one where you compile your program, use +DAmodel with the model number of the target system.

    For example, if you are compiling on a 720 and your program will run on an 855, you should use +DA855. This will give you the best performance on the 855.

  • If you plan to run your program on PA-RISC 2.0 and 1.1 HP 9000 systems, use +DAportable to ensure portability.

If you do not specify +DA or +DS, the default instruction scheduling is based on that of the system on which you compile. If you do specify a +DA option and do not specify a +DS option, the default instruction scheduling is based on what you specify in +DA, and not based on that of the system on which you compile. For example, if you specify +DA1.1 and do not specify +DS, and instruction scheduling will be for 1.1. If you specify +DAportable and do not specify +DS, and instruction scheduling will be for 1.1. (+DAportable is currently equivalent to +DA1.1.)

Using +DS to Specify Instruction Scheduling

Instruction scheduling is different on different implementations of PA-RISC architectures. You can improve performance on a particular model or processor of the HP 9000 by requesting that the compiler use instruction scheduling tuned to that particular model or processor. Using scheduling for one model or processor does not prevent your program from executing on another model or processor.

Use the +DS option to specify instruction scheduling tuned to a particular implementation of PA-RISC. Note that model can be a model number of an HP 9000 system (such as 730, 877, or H40); a PA-RISC architecture designation 1.1 or 2.0; or one of the PA-RISC processor names (such as PA7000, PA7100, PA7100LC, or PA8000.)

For example, to specify instruction scheduling for the model 867, use +DS867. To specify instruction scheduling for the PA-RISC 7100LC processor, use +DSPA7100LC. To specify instruction scheduling for systems based on the PA-RISC 8000 processor, use +DSPA8000.

If you plan to run your program on both PA-RISC 1.1 and 2.0 systems, in general we recommend you use the +DS2.0 designation.

See the file /opt/langtools/lib/sched.models for model numbers and processor names. Use the command uname -m to determine the model number of your system.

If you do not specify a +DA or +DS option, the default instruction scheduling is based on that of the system on which you compile. If you do specify a +DA option and do not specify a +DS option, the default instruction scheduling is based on what you specify in +DA, and not based on that of the system on which you compile. For example, if you specify +DA1.1 and do not specify +DS, and instruction scheduling will be for 1.1. Specify +DAportable and do not specify +DS, and instruction scheduling will be for 1.1. (+DAportable is currently equivalent to +DA1.1.)

When you use the +DS option depends on your particular circumstance.

  • If you plan to run your program on one particular model of the HP 9000 and that model is different from the one where you compile your program, use +DSmodel with either the model number of the target system or the processor name of the target system.

    For example, if you are compiling on a system with a PA7100 processor and your program will run on a system with a PA7100LC processor, you should use +DSPA7100LC. This will give you the best performance on the PA7100LC system.

  • If you plan to run your program on many models or processors of the HP 9000, use +DSmodel with either the model number or processor name of the fastest system on which you will be running your application.

Compiling in Networked Environments

When compiles are performed using diskless workstations or NFS-mounted file systems, it is important to note that the default code generation and scheduling are based on the local host processor. The system model numbers of the hosts where the source or object files reside do not affect the default code generation and scheduling.

© Hewlett-Packard Development Company, L.P.