You can use the -q32, -q64, -qarch, and -qtune compiler options to optimize the output of the compiler to suit:
- the broadest possible selection of target processors,
- a range of processors within a given processor architecture family,
- a single specific processor.
Generally speaking, the options do the following:
- -q32 selects 32-bit execution mode.
- -q64 selects 64-bit execution mode.
- -qarch selects the general family processor architecture for which instruction code should be generated. Certain -qarch settings produce code that will run only on systems that support all of the instructions generated by the compiler in response to a chosen -qarch setting.
- -qtune selects the specific processor for which compiler output is optimized. Some -qtune settings can also be specified as -qarch options, in which case they do not also need to be specified as a -qtune option. The -qtune option influences only the performance of the code when running on a particular system but does not determine where the code will run.
All PowerPC machines share a common set of instructions, but may also include additional instructions unique to a given processor or processor family.
The table below shows some selected processors, and the various features they may or may not support:
Processor graphics support sqrt support 64-bit support rs64b yes yes yes rs64c yes yes yes pwr3 yes yes yes pwr4 yes yes yes pwr5 yes yes yes
If you want to generate code that will run across a variety of processors, use the following guidelines to select the appropriate -qarch and/or -qtune compiler options. Code compiled with:
- -qarch=pwr4 will run only on POWER4 machines.
- -qarch=pwr5 will run only on POWER5 machines.
- -qarch=ppc will run on any PowerPC system.
- -q64 will run only on PowerPC machines with 64-bit support
- Other -qarch options that refer to specific processors will run on any functionally equivalent PowerPC machine. For example, the table that follows shows that code compiled with -qarch=pwr3 will also run on a rs64c.
If you want to generate code optimized specifically for a particular processor, acceptable combinations of -q32, -q64, -qarch, and -qtune compiler options are shown in the following table.
Related references
Acceptable -qarch /-qtune combinations | |||
---|---|---|---|
-qarch option | Predefined macros | Default -qtune setting | Available -qtune settings |
ppc64v | _ARCH_PPCV | ppc970 | auto
ppc970 |
Related references