Specifying compiler options for architecture-specific,
32-bit or 64-bit compilation
You can use XL C/C++ compiler options to optimize compiler output
for use on specific processor architectures. You can
also instruct the compiler to compile in either 32-bit or 64-bit mode.
The compiler evaluates compiler options in the following order, with the
last allowable one found determining the compiler mode:
- Internal default (32-bit mode)
- 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.
- 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.
- 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.
Possible option conflicts and compiler resolution of these conflicts are
described below:
- -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 -q32/-q64 compiler
settings.
Related information