Specifies the general processor architecture for which the code (instructions) should be generated.
In general, the -qarch option allows you to target a specific architecture for the compilation. For any given -qarch setting, the compiler defaults to a specific, matching -qtune setting, which can provide additional performance improvements. The resulting code may not run on other architectures, but it will provide the best performance for the selected architecture. To generate code that can run on more than one architecture, specify a -qarch suboption that supports a group of architectures, such as ppc, or ppc64; doing this will generate code that runs on all supported architectures, all PowerPC architectures, or all 64-bit PowerPC architectures, respectively. When a -qarch suboption is specified with a group argument, you can specify -qtune as either auto, or provide a specific architecture in the group. In the case of -qtune=auto, the compiler will generate code that runs on all architectures in the group specified by the -qarch suboption, but select instruction sequences that have best performance on the architecture of the machine used to compile. Alternatively you can target a specific architecture for tuning performance.
.-ppc64grsq-. >>- -q--arch--=--+-auto------+--------------------------------->< +-pwr3------+ +-pwr4------+ +-pwr5------+ +-pwr5x-----+ +-ppc-------+ +-ppc64v----+ +-ppc64-----+ +-ppcgr-----+ +-ppc64gr---+ +-ppc970----+ +-rs64b-----+ '-rs64c-----'
where available options specify broad families of processor architectures or subgroups of those architecture families, described below.
auto |
|
pwr3 |
|
pwr4 |
|
pwr5 |
|
pwr5x |
|
ppc |
|
ppc64 |
|
ppcgr |
|
ppc64gr |
|
ppc64grsq |
|
ppc64v |
|
ppc970 |
|
rs64b |
|
rs64c |
|
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 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. If -qarch is specified without -qtune, the compiler uses the default tuning option for the specified architecture, and the listing shows the effective -qtune setting.
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 -q32 -qarch=ppc
Related information