-qarch

Description

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 com, 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.

Syntax

Read syntax diagramSkip visual syntax diagram                 .-com-------.
>>- -q--arch--=--+-auto------+---------------------------------><
                 +-403-------+
                 +-601-------+
                 +-602-------+
                 +-603-------+
                 +-604-------+
                 +-pwr-------+
                 +-pwr2------+
                 +-p2sc------+
                 +-pwr2s-----+
                 +-pwr3------+
                 +-pwr4------+
                 +-pwr5------+
                 +-pwr5x-----+
                 +-ppc-------+
                 +-ppc64v----+
                 +-ppc64-----+
                 +-ppcgr-----+
                 +-ppc64gr---+
                 +-ppc64grsq-+
                 +-ppc970----+
                 +-rs64a-----+
                 +-rs64b-----+
                 '-rs64c-----'

where available options specify broad families of processor architectures or subgroups of those architecture families, described below.

com
  • In 32-bit execution mode, produces object code containing instructions that will run on any of 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(R) hardware platforms but not 32-bit-only platforms.
  • Defines the _ARCH_COM macro.
  • Specifying -qarch=com together with -q64 silently upgrades the architecture setting to -qarch=ppc64.
  • This is the default option unless the -q64, -O4 or -O5 compiler options are specified.
  • If -q64 is specified, this option is silently upgraded to ppc64.
auto
  • This option is implied if -O4 or -O5 is set or implied.
  • Produces object code containing instructions that will run on the hardware platform on which it is compiled.
403
  • Produces object code containing instructions that will run on the PowerPC 403 hardware platform.
  • Defines the _ARCH_COM, _ARCH_PPC and _ARCH_403 macros.
601
  • Produces object code containing instructions that will run on the PowerPC 601 hardware platform.
  • Defines the _ARCH_COM, _ARCH_PWR, _ARCH_PPC, and _ARCH_601 macros.
  • This option is not valid if -q64 is set or implied.
602
  • Produces object code containing instructions that will run on the PowerPC 602 hardware platform.
  • Defines the _ARCH_COM, _ARCH_PPC and _ARCH_602 macros.
  • This option is not valid if -q64 is set or implied.
603
  • Produces object code containing instructions that will run on the PowerPC 603 hardware platform.
  • Defines the _ARCH_COM, _ARCH_PPC, _ARCH_PPCGR, and _ARCH_603 macros.
  • This option is not valid if -q64 is set or implied.
604
  • Produces object code containing instructions that will run on the PowerPC 604 hardware platform.
  • Defines the _ARCH_COM, _ARCH_PPC, _ARCH_PPCGR, and _ARCH_604 macros.
  • This option is not valid if -q64 is set or implied.
pwr
  • Produces object code containing instructions that will run on any of the POWER, POWER2, and PowerPC 601 hardware platforms.
  • Defines the _ARCH_COM and _ARCH_PWR macros.
  • This option is not valid if -q64 is set or implied.
pwr2
  • Produces object code containing instructions that will run on any POWER2 platform.
  • Defines the _ARCH_COM, _ARCH_PWR and _ARCH_PWR2 macros.
  • This option is not valid if -q64 is set or implied.
Note:
pwrx is a synonym for pwr2, but pwr2 is preferable.
pwr2s
  • Produces object code containing instructions that will run on POWER2 Chip desktop implementations.
  • Defines the _ARCH_COM, _ARCH_PWR, _ARCH_PWR2, and _ARCH_PWR2S macros.
  • This option is not valid if -q64 is set or implied.
p2sc
  • Produces object code containing instructions that will run on the POWER2 Super Chip hardware platform.
  • Defines the _ARCH_COM, _ARCH_PWR, _ARCH_PWR2, and _ARCH_P2SC macros.
  • This option is not valid if -q64 is set or implied.
pwr3
  • Produces object code containing instructions that will run on any POWER3(TM), POWER4(TM), POWER5(TM), POWER5+(TM) or PowerPC 970 hardware platform.
  • Defines the _ARCH_COM, _ARCH_PPC, _ARCH_PPCGR, _ARCH_PPC64, _ARCH_PPC64GR, _ARCH_PPC64GRSQ, and _ARCH_PWR3 macros.
pwr4
  • Produces object code containing instructions that will run on the POWER4, POWER5, POWER5+ or PowerPC 970 hardware platform.
  • Defines the _ARCH_COM, _ARCH_PPC, _ARCH_PPCGR, _ARCH_PPC64, _ARCH_PPC64GR, _ARCH_PPC64GRSQ, _ARCH_PWR3, and _ARCH_PWR4 macros.
pwr5
  • Produces object code containing instructions that will run on the POWER5 or POWER5+ hardware platforms.
  • Defines the _ARCH_COM, _ARCH_PPC, _ARCH_PPCGR, _ARCH_PPC64, _ARCH_PPC64GR, _ARCH_PPC64GRSQ, _ARCH_PWR3, _ARCH_PWR4, and _ARCH_PWR5 macros.
pwr5x
  • Produces object code containing instructions that will run on the POWER5+ hardware platforms.
  • Defines the _ARCH_COM, _ARCH_PPC, _ARCH_PPCGR, _ARCH_PPC64, _ARCH_PPC64GR, _ARCH_PPC64GRSQ, _ARCH_PWR3, _ARCH_PWR4, _ARCH_PWR5 and _ARCH_PWR5X macros.
ppc
  • This is the default if -q32 is set or implied.
  • In 32-bit mode, produces object code containing 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_COM and _ARCH_PPC macro.
  • Specifying -qarch=ppc together with -q64 silently upgrades the architecture setting to -qarch=ppc64.
ppc64
  • Produces object code that will run on any of the 64-bit PowerPC hardware platforms.
  • This suboption can be selected when compiling in 32-bit mode, but the resulting object code may include instructions that are not recognized or behave differently when run on 32-bit PowerPC platforms.
  • Defines the _ARCH_COM, _ARCH_PPC and _ARCH_PPC64 macros.
ppcgr
  • In 32-bit mode, produces object code for PowerPC processors that support optional graphics instructions.
  • Specifying -qarch=ppcgr together with -q64 silently upgrades the architecture setting to -qarch=ppc64gr.
  • Defines the _ARCH_COM, _ARCH_PPC and _ARCH_PPCGR macros.
ppc64gr
  • Produces code for any 64-bit PowerPC hardware platform that supports optional graphics instructions.
  • Defines the _ARCH_COM, _ARCH_PPC, _ARCH_PPCGR, _ARCH_PPC64, and _ARCH_PPC64GR macros.
ppc64grsq
  • Produces code for any 64-bit PowerPC hardware platform that supports optional graphics and square root instructions.
  • Defines the _ARCH_COM, _ARCH_PPC, _ARCH_PPCGR, _ARCH_PPC64, _ARCH_PPC64GR, and _ARCH_PPC64GRSQ macros.
ppc64v
  • Generates instructions for generic PowerPC chips with AltiVec vector processors. Valid in 32-bit or 64-bit mode. The default in 64-bit mode.
  • Defines the _ARCH_COM, _ARCH_PPC, _ARCH_PPCGR, _ARCH_PPC64, _ARCH_PPC64GR, _ARCH_PPC64GRSQ, _ARCH_PPC64V macros.
ppc970
  • Generates instructions specific to the PowerPC 970 architecture.
  • Defines the _ARCH_COM, _ARCH_PPC, _ARCH_PPC64V, _ARCH_PPCGR, _ARCH_PPC64, _ARCH_PPC970, _ARCH_PWR3, _ARCH_PWR4, _ARCH_PPC64GR, and_ARCH_PPC64GRSQ macros.
rs64a
  • Produces object code that will run on RS64I platforms.
  • Defines the _ARCH_COM, _ARCH_PPC, _ARCH_PPC64, and _ARCH_RS64A macros.
rs64b
  • Produces object code that will run on RS64II platforms.
  • Defines the _ARCH_COM, _ARCH_PPC, _ARCH_PPCGR, _ARCH_PPCGRSQ, _ARCH_PPC64, _ARCH_PPC64GR, _ARCH_PPC64GRSQ, and _ARCH_RS64B macros.
rs64c
  • Produces object code that will run on RS64III platforms.
  • Defines the _ARCH_COM, _ARCH_PPC, _ARCH_PPCGR, _ARCH_PPCGRSQ, _ARCH_PPC64, _ARCH_PPC64GR, _ARCH_PPC64GRSQ, and _ARCH_RS64C macros.

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.

Using -qarch=ppc or any PPC family architecture with -qfloat=hssngl or -qfloat=hsflt may produce incorrect results on RS64II 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. If -qarch is specified without -qtune, the compiler uses the default tuning option for the specified architecture, and the listing shows: TUNE=DEFAULT.

Specifying -q64 silently performs the following upgrades:

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 -q32 -qarch=ppc

Related information