-mcpu (-qarch)

Pragma equivalent

None.

Purpose

Specifies the processor architecture for which the code (instructions) should be generated.

Syntax

Read syntax diagramSkip visual syntax diagram
             .-=power8-.   
             +-=pwr8---+   
>>- -m--cpu--+---------+---------------------------------------><

Read syntax diagramSkip visual syntax diagram
              .-=--pwr8-.   
>>- -q--arch--+-=--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.
pwr8
Produces object code containing instructions that run on the POWER8® hardware platforms.
power8
Produces object code containing instructions that run on the POWER8 hardware platforms. You can specify this suboption with -march only.

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).

The POWER8 architecture supports graphics, square root, Vector Multimedia Extension (VMX) processing, Vector Scalar Extension (VSX) processing, hardware transactional memory, and cryptography.

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, enter:
xlc -o testing myprogram.c -mcpu=pwr8


Voice your opinion on getting help information Ask IBM compiler experts a technical question in the IBM XL compilers forum Reach out to us