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:
com | In 32-bit execution mode, 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. In 64-bit mode, produces object code that will run on all the 64-bit PowerPC hardware platforms but not 32-bit-only platforms. This is the default option unless the -O4 compiler option was specified. Defines the _ARCH_COM macro and produces portable programs. |
pwr | Produces object code that contains instructions that will run on any of the POWER and POWER2 and 601 hardware platforms. Defines the _ARCH_PWR macro. |
pwr2 | Produces object code that contains instructions that will run on the POWER2 hardware platforms including pwr2s and p2sc. Defines the _ARCH_PWR and _ARCH_PWR2 macros. |
pwr3 | Produces object code that contains instructions that will run on the POWER3 hardware platforms. Defines the _ARCH_PWR and _ARCH_PWR3 macros. |
ppc | In 32-bit mode, 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. In 64-bit mode, produces object code that will run on any of the 64-bit PowerPC hardware platforms but not 32-bit-only platforms. Defines the _ARCH_PPC macro. |
ppcgr | In 32-bit mode, produces object code that contains optional graphics
instructions for PowerPC processors. In 64-bit mode, produces object code that contains optional graphics instructions for 64-bit PowerPC hardware platforms but not 32-bit-only platforms. Defines the _ARCH_PPC and _ARCH_PPCGR macros. |
auto | Produces object code that contains instructions that will run on the hardware platform on which it is compiled. |
Note: Using -qarch=ppc or any ppc family architecture with -qfloat=hssngl or -qfloat=hsflt may produce incorrect results on rs64b or future systems.
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 -qarch is -qarch=com
unless the OBJECT_MODE environment variable is set to 64.
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
Specify Compiler Options for Architecture-Specific, 32- or
64-bit Compilation
Acceptable Compiler Mode and Processor Architecture Combinations
List of Batch Compiler Options and Their Defaults
Options that Define the Compiler Object Code Produced
Equivalent Batch Compile-Link and Incremental
Build Options