You copied the Doc URL to your clipboard.

-march

Targets an architecture profile, generating generic code that runs on any processor of that architecture.

Syntax

To specify a target architecture, use:

-march=name

-march=name[+[no]feature+…] (for architectures with optional extensions)

Where:

name

Specifies the architecture.

To view a list of all the supported architectures, use:

-march=list

The following are valid -march values:

armv8-a

ARMv8 application architecture profile. Valid with both --target=aarch64-arm-none-eabi and --target=arm-arm-none-eabi.

armv8.1-a

ARMv8.1 application architecture profile. Valid with both --target=aarch64-arm-none-eabi and --target=arm-arm-none-eabi.

armv8.2-a

ARMv8.2 application architecture profile. Valid with both --target=aarch64-arm-none-eabi and --target=arm-arm-none-eabi.

armv8.3-a

ARMv8.3 application architecture profile. Valid with both --target=aarch64-arm-none-eabi and --target=arm-arm-none-eabi.

armv8-r

ARMv8 real-time architecture profile. Only valid with --target=arm-arm-none-eabi.

armv8-m.base

ARMv8 baseline microcontroller architecture profile. Derived from the ARMv6-M architecture. Only valid with --target=arm-arm-none-eabi.

armv8-m.main

ARMv8 mainline microcontroller architecture profile. Derived from the ARMv7-M architecture. Only valid with --target=arm-arm-none-eabi.

armv7-a

ARMv7 application architecture profile. Only valid with --target=arm-arm-none-eabi.

armv7-r

ARMv7 real-time architecture profile. Only valid with --target=arm-arm-none-eabi.

armv7-m

ARMv7 microcontroller architecture profile. Only valid with --target=arm-arm-none-eabi.

armv7e-m

ARMv7 microcontroller architecture profile with DSP extension. Only valid with --target=arm-arm-none-eabi.

armv6-m

ARMv6 microcontroller architecture profile. Only valid with --target=arm-arm-none-eabi.

feature

Enables or disables an optional architectural feature. See the documentation for -mcpu.

Note

There are no software floating-point libraries for AArch64 targets. At link time armlink links against AArch64 library code that can use floating-point and SIMD instructions and registers. This still applies if you compile the source with -march=<name>+nofp+nosimd to prevent the compiler from using floating-point and SIMD instructions and registers.

To prevent the use of any floating-point instruction or register, either re-implement the library functions or create your own library that does not use floating-point instructions or registers.

Default

For AArch64 targets (--target=aarch64-arm-none-eabi), unless you target a particular processor using -mcpu, the compiler defaults to -march=armv8-a, generating generic code for ARMv8-A in AArch64 state.

For AArch32 targets (--target=arm-arm-none-eabi), there is no default. You must specify either -march (to target an architecture) or -mcpu (to target a processor).

Was this page helpful? Yes No