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.
The compiler evaluates compiler options in the following order,
with the last allowable one found determining the compiler mode:
- Internal default (32-bit mode)
- OBJECT_MODE environment variable setting
- Configuration file settings
- Command line compiler options (-q32, -q64, -qarch, -qtune)
- Source file statements (#pragma options tune=suboption)
The compilation mode actually used by the compiler depends on a
combination of the settings of the -q32, -q64, -qarch and -qtune compiler
options, subject to the following conditions:
- Compiler mode is set according to the last-found instance
of the -q32 or -q64 compiler options. If
neither of these compiler options is set, the compiler mode is set
by the value of the OBJECT_MODE environment variable. If the OBJECT_MODE
environment variable is also not set, the compiler assumes 32-bit
compilation mode.
- Architecture target is set according to the last-found
instance of the -qarch compiler option, provided that the specified -qarch setting
is compatible with the compiler mode setting. If the -qarch option
is not set, the compiler sets -qarch to the appropriate default
based on the effective compiler mode setting. See -qarch for details.
- Tuning of the architecture target is set according to the last-found
instance of the -qtune compiler option, provided that the -qtune setting
is compatible with the architecture target and compiler
mode settings. If the -qtune option is not set, the compiler
assumes a default -qtune setting according to the -qarch setting
in use. If -qarch is not specified, the compiler sets -qtune to
the appropriate default based on the effective -qarch as selected
by default based on the effective compiler mode setting.
Allowable combinations of these options are found in -qtune.
The following list describes possible option conflicts and compiler
resolution of these conflicts:
- -q32 or -q64 setting is incompatible with user-selected -qarch option.
Resolution: -q32 or -q64 setting overrides -qarch option;
compiler issues a warning message, sets -qarch to its default
setting, and sets the -qtune option accordingly to its default
value.
- -qarch option is incompatible with user-selected -qtune option.
Resolution: Compiler issues a warning message, and sets -qtune to
the -qarch setting's default -qtune value.
- Selected -qarch or -qtune options are not known
to the compiler.
Resolution: Compiler issues a warning
message, sets -qarch and -qtune to their default settings.
The compiler mode (32-bit or 64-bit) is determined by the OBJECT_MODE environment variable or -q32/-q64 compiler
settings.