Option Type | Default Value | #pragma options | C | C++ |
-qoption | arch=com | - | x | x |
Syntax
-qarch=suboption
Purpose
Specifies the general processor architecture for which the code (instructions) should
be generated.
Notes
If you want maximum performance on a specific architecture and will not be using the
program on other architectures, use the appropriate architecture option. You can specify
the architecture using the following basic suboptions:
auto | Automatically detects the specific architecture of the compiling machine.
Use this suboption only if the execution environment is the same as the compilation environment. |
com | Produces object code that contains instructions that will run on all the
POWER, POWER2*, and PowerPC* hardware platforms (that is, the instructions generated are common
to all platforms. Using -qarch=com is referred to as compiling in common
mode) Defines the _ARCH_COM macro. Use this option if you want your program to be portable. |
pwr | Produces object code that contains instructions that will run on any of the POWER and POWER2 hardware platforms. Defines the _ARCH_PWR macro. |
pwr2 | Produces object code that contains instructions that will run on the POWER2 hardware platforms. Defines the _ARCH_PWR and _ARCH_PWR2 macros. |
pwrx | Produces object code that contains instructions that will run on the POWER2 hardware platforms (same as -qarch=pwr2). Defines the _ARCH_PWR and _ARCH_PWR2 macros. |
ppc | Produces object code that contains instructions that will run on any of the 32-bit PowerPC hardware platforms. This suboption will cause the compiler to produce single-precision instructions to be used with single-precision data. Defines the _ARCH_PPC macro. |
ppcgr | Produces object code that contains optional graphics instructions for PowerPC processors. Defines the _ARCH_PPC and _ARCH_PPCGR macros. |
noauto | Valid only when the -O4 compiler option is in effect, this option disables automatic setting of the -qarch and qtune compiler options. |
Additional -qarch suboptions for specific processors can be found in the Acceptable Compiler Mode and Processor Architecture Combinations table.
You can use -qarch=suboption with -qtune=suboption. -qarch=suboption specifies the architecture for which the instructions are to be generated, and -qtune=suboption specifies the target platform for which the code is optimized.
Default
The default setting of the -qarch option depends on the setting of
the -qtune option.
If -qtune is specified without -qarch, the compiler uses -qarch=com.
If -qarch is specified without -qtune, the compiler uses the default tuning option for the specified architecture. Listings will show only:
TUNE=DEFAULT
To find the actual default -qtune setting for a given -qarch setting, refer to the Acceptable Compiler Mode and Processor Architecture Combinations table.
Example
To specify that the executable program testing compiled from myprogram.c is to run on
a computer with a 32-bit PowerPC architecture, enter:
xlC -o testing myprogram.c -qarch=ppc
Specifying Compiler Options for Architecture-Specific, 32-
or 64-bit Compilation
Acceptable Compiler Mode and Processor Architecture Combinations
List of Compiler Options and Their Defaults
Options that Define the Compiler Object Code Produced