You can specify the CPU architecture of the target processor with the gen(arch, CPUtype) option. This option determines the instruction set used to generate code. To optimize code for a specific processor, use the opt(tune, CPUtype) option.
The following table shows what values you can specify for CPUtype in these two options. When a CPUtype is valid only for a particular option, this is indicated in the third column.
CPUtype |
Description | Notes |
|---|---|---|
common |
Valid only for gen(arch). This is the default gen(arch) setting. | |
pwr |
POWER hardware platforms | |
pwr2 |
POWER2 hardware platforms | |
pwrx |
POWER2 hardware platforms; same as pwr2 | |
ppc |
PowerPC hardware platforms | Valid only for gen(arch) |
ppcgr |
PowerPC graphics enhanced | Valid only for gen(arch) |
pwr2s |
POWER2 hardware platforms; avoids quadruple-precision instructions that can slow performance | |
403 |
PowerPC 403 processor | |
601 |
PowerPC 601 processor | |
602 |
PowerPC 602 processor | |
603 |
PowerPC 603 processor | |
604 |
PowerPC 604 processor | |
rs64a |
RS64A processor |
The table below indicates the relationship between the CPUtype specified for the gen(arch) option and the corresponding default and allowed CPUtypes for the opt(tune) option. If you attempt to use a gen(arch) and opt(tune) combination that is invalid, a warning message will be issued. The gen(arch) setting is accepted, and the default opt(tune) setting corresponding to that gen(arch) setting is assumed.
| gen(arch, CPUtype) | Predefined Macro |
Allowed opt(tune, CPUtype) |
Default opt(tune, CPUtype) |
|---|---|---|---|
| common | _ARCH_COM |
DEFAULT (not selectable) pwr pwr2 pwrx 601 602 603 604 403 pwr2s rs64a |
pwr |
| pwr | _ARCH_PWR |
pwr pwr2 pwrx 601 pwr2s |
pwr |
| pwr2 pwrx |
_ARCH_PWR _ARCH_PWR2 |
pwr2 pwrx pwr2s |
pwr2 |
| ppc | _ARCH_PPC |
601 602 603 604 403 rs64a |
604 |
| ppcgr |
_ARCH_PPC _ARCH_PPCGR |
603 604 |
604 |
| pwr2s | _ARCH_PWR _ARCH_PWR2 _ARCH_PWR2S |
pwr2s |
pwr2s |
| 403 | _ARCH_PPC _ARCH_403 |
403 |
403 |
| 601 | _ARCH_601 |
601 |
601 |
| 602 | _ARCH_PPC _ARCH_602 |
602 |
602 |
| 603 | _ARCH_PPC _ARCH_PPCGR _ARCH_603 |
603 |
603 |
| 604 | _ARCH_PPC _ARCH_PPCGR _ARCH_604 |
604 |
604 |
| rs64a |
_ARCH_PPC _ARCH_RS64A |
rs64a |
rs64a |
| Use ppcgr to enable graphics instructions on the RS64A processor. | |||
![]()
Code Generation Options
Optimization Options
