-
Notifications
You must be signed in to change notification settings - Fork 0
Understanding GCC's Target Specific Options
In addition to the common options, GCC also supports a set of -m<value> target specific options. Each of them
configures a particular feature or an extension. For example, -mno-code-density option disables generating code
density instructions.
-mcpu=<core> selects a particular ISA and CPU family and enables/disables a set of other -m options.
Each -mcpu value leads to linking with a prebuilt library which corresponds to this particular
-mcpu=<value> and is built using this -mcpu=<value>.
For example, option combination -mcpu=em4 -mno-code-density will generate code that doesn't
use code density instructions, however it will be linked with standard library that has been built
with just -mcpu=em4, which uses code density instructions - therefore a final application still may
use code density instructions.
There are several configurations files in GCC's source tree which describe
target options for all targets. All of them may be found in gcc/config/arc
directory:
-
arc-options.def,arc-opts.h,arc.opt- definitions and descriptions for all target options. -
arc-arches.def- definitions of CPU families with all available and default target options. -
arc-cpus.def- definitions of particular-mcpu=<core>targets.
Here is a comparison table for all ARCv1 and ARCv2 CPU families.
| Options | ARC HS | ARC EM | ARC 700 | ARC 600 |
|---|---|---|---|---|
-mbarrel-shifter |
Default | Yes | Default | Yes |
-mnorm |
Default | Yes | Default | Yes |
-mswap |
Default | Yes | Default | Yes |
-rf16 |
Yes | Yes | Yes | Yes |
-mfpu=<...> |
Yes | Yes | — | — |
-mmpy-option=<...> |
Yes | Yes | — | — |
-mcode-density |
Default | Yes | — | — |
-mdiv-rem |
Yes | Yes | — | — |
-matomic |
Default | — | Yes | — |
-mll64 |
Yes | — | — | — |
-mspfp |
— | Yes | Yes | Yes |
-mdpfp |
— | Yes | Yes | Yes |
-msimd |
— | Yes | Yes | — |
-mmargonaut |
— | — | Yes | Yes |
-mea |
— | — | Yes | — |
-mmul64 |
— | — | — | Yes |
-mmul32x16 |
— | — | — | Yes |
Here is a table which matches -mfpu= values to corresponding features for ARC EM and ARC HS as they defined in Architect.
-mfpu= |
Families | -has_fpu |
-fpu_dp_option |
-fpu_div_option |
-fpu_fma_option |
-fpu_dp_assist |
|---|---|---|---|---|---|---|
fpus |
EM, HS | On | — | — | — | — |
fpus_div |
EM, HS | On | — | On | — | — |
fpus_fma |
EM, HS | On | — | — | On | — |
fpus_all |
EM, HS | On | — | On | On | — |
fpud |
HS | On | On | — | — | — |
fpud_div |
HS | On | On | On | — | — |
fpud_fma |
HS | On | On | — | On | — |
fpud_all |
HS | On | On | On | On | — |
fpuda |
EM | On | — | — | — | On |
fpuda_div |
EM | On | — | On | — | On |
fpuda_fma |
EM | On | — | — | On | On |
fpuda_all |
EM | On | — | On | On | On |
Here is a table which matches -mmpy= values to corresponding features for ARC EM and ARC HS as they defined in Architect.
-mcpu= |
Aliases | Architect option for ARC HS | Architect option for ARC EM |
|---|---|---|---|
| 0 | none |
-mpy_option=none |
-mpy_option=none |
| 1 | w |
— | — |
| 2 |
wlh1, mpy
|
-mpy_option=mpy |
-mpy_option=wlh1 |
| 3 | wlh2 |
— | -mpy_option=wlh2 |
| 4 | wlh3 |
— | -mpy_option=wlh3 |
| 5 | wlh4 |
— | -mpy_option=wlh4 |
| 6 | wlh5 |
— | -mpy_option=wlh5 |
| 7 | plus_dmpy |
-mpy_option=plus_dmpy |
— |
| 8 | plus_macd |
-mpy_option=plus_macd |
— |
| 9 | plus_qmacw |
-mpy_option=plus_qmacw |
— |
-mcpu= |
-mdiv-rem |
-matomic |
-mll64 |
-mmpy-option= |
-mfpu= |
|---|---|---|---|---|---|
hs |
Y | ||||
hs34 |
Y | mpy |
|||
archs |
Y | Y | Y | mpy |
|
hs38 |
Y | Y | Y | plus_qmacw |
|
hs4x |
Y | Y | Y | plus_qmacw |
|
hs4xd |
Y | Y | Y | plus_qmacw |
|
hs38_linux |
Y | Y | Y | plus_qmacw |
fpud_all |
-mcpu= |
-msimd |
-m128 |
-mll64 |
|---|---|---|---|
hs5x |
Y | N/A | |
hs58 |
Y | N/A | Y |
hs6x |
Y | N/A | |
hs68 |
Y | Y | N/A |
-mcpu |
-mcode-density |
-mnorm |
-mswap |
-mbarrel-shifter |
-mdiv-rem |
-mmpy-option= |
-mfpu= |
-mrf16 |
|---|---|---|---|---|---|---|---|---|
em |
||||||||
em_mini |
Y | |||||||
em4 |
Y | |||||||
arcem |
Y | Y | wlh1 |
|||||
em4_dmips |
Y | Y | Y | Y | Y | wlh1 |
||
em4_fpus |
Y | Y | Y | Y | Y | wlh1 |
fpus |
|
em4_fpuda |
Y | Y | Y | Y | Y | wlh1 |
fpuda |
|
quarkse_em |
Y | Y | Y | Y | Y | wlh2 |
quark |
-mcpu= |
-mnorm |
-mswap |
-mbarrel-shifter |
Multiplier |
|---|---|---|---|---|
arc700 |
Y | Y | Y | -mmpy |
arc600 |
Y | |||
arc600_norm |
Y | Y | ||
arc600_mul64 |
Y | Y | -mmul64 |
|
arc600_mul32x16 |
Y | Y | -mmul32x16 |
|
arc601 |
||||
arc601_norm |
Y | |||
arc601_mul64 |
Y | -mmul64 |
||
arc601_mul32x16 |
Y | -mmul32x16 |