-mcpu (-qarch)
Category
Pragma equivalent
None.
Purpose
Specifies the processor architecture for which the code (instructions) should be generated.
Syntax
.-=power8-. +-=pwr8---+ >>- -m--cpu--+-=pwr9---+--------------------------------------->< '-=power9-'
.-=--pwr8-. >>- -q--arch--+-=--pwr9-+-------------------------------------->< '-=--auto-'
Defaults
- -mcpu=pwr8, -mcpu=power8, or -qarch=pwr8
- -qarch=auto when -O4 or -O5 is in effect
Parameters
- auto
- Automatically detects the specific architecture of the compiling machine. It assumes that the execution environment will be the same as the compilation environment. This option is implied if the -O4 or -O5 option is set or implied. You can specify the auto suboption with -qarch only.
- power8
- Produces object code containing instructions that run on the POWER8® or POWER9™ hardware platforms. You can specify this suboption with -mcpu only.
- power9
- Produces object code containing instructions that utilize the POWER9 technology. You can specify this suboption with -mcpu only.
- pwr8
- Produces object code containing instructions that run on the POWER8 or POWER9 hardware platforms.
- pwr9
- Produces object code containing instructions that utilize the POWER9 technology.
Usage
For any given -mcpu or -qarch setting, the compiler defaults to a specific, matching -mtune or -qtune setting, which can provide additional performance improvements. For detailed information about using -mcpu (-qarch) and -mtune (-qtune) together, see -mtune (-qtune).
Predefined macros
See Macros related to architecture settings for a list of macros that are predefined by -mcpu (-qarch) suboptions.
Examples
To specify that the executable
program testing compiled from myprogram.c is
to run on a computer with VSX instruction
support, for example, power8, enter:
xlc -o testing myprogram.c -mcpu=pwr8