Skip to content

Understanding GCC's Target Specific Options

Yuriy Kolerov edited this page Jun 15, 2023 · 16 revisions

Overview

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.

Values of -mcpu for ARC HS5x and ARC HS6x Families

-mcpu= -msimd -m128 -mll64
hs5x Y N/A
hs58 Y N/A Y
hs6x Y N/A
hs68 Y Y N/A

Values of -mcpu for ARC HS Family

-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

Values of -mcpu for ARC EM Family

-mcpu -mcode-density -mnorm -mswap -mbarrel-shifter -mdiv-rem -mmpy-option= -mfpu= -mrf16
em
em_mini Y
em4 Y Y
arcem Y Y wlh1 Y
em4_dmips Y Y Y Y Y wlh1 Y
em4_fpus Y Y Y Y Y wlh1 fpus Y
em4_fpuda Y Y Y Y Y wlh1 fpuda Y

Values of -mcpu for ARC 600 and 700 Families

-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
Clone this wiki locally