You copied the Doc URL to your clipboard.

Arm Compiler armclang Reference Guide : -march

-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
Arm®v8 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.4-a
Armv8.4 application architecture profile. Valid with both --target=aarch64-arm-none-eabi and --target=arm-arm-none-eabi.
armv8.5-a
Armv8.5 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 microcontroller architecture profile without the Main Extension. Derived from the Armv6‑M architecture. Only valid with --target=arm-arm-none-eabi.
armv8-m.main
Armv8 microcontroller architecture profile with the Main Extension. 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

To write code that generates instructions for these extensions, use theIs an optional architecture feature that might be enabled or disabled by default depending on the architecture or processor.

Note

In general, if an architecture supports the optional feature, then this optional feature is enabled by default. To determine whether the optional feature is enabled, use fromelf ‑‑decode_build_attributes.

+feature enables the feature if it is disabled by default. +feature has no effect if the feature is already enabled by default.

+nofeature disables the feature if it is enabled by default. +nofeature has no effect if the feature is already disabled by default.

Use +feature or +nofeature to explicitly enable or disable an optional architecture feature.

For targets in AArch64 state, you can specify one or more of the following features if the architecture supports it:

  • aes - Cryptographic extension. See Cryptographic extensions for more information.
  • crc - CRC extension.
  • crypto - Cryptographic extension. See Cryptographic extensions for more information.
  • dotprod - Enables the SDOT and UDOT instructions. Supported in the Armv8.2 and later Application profile architectures, and is optional in Armv8.2 and Armv8.3.
  • fp - Floating-point extension. See Floating-point extensions for more information.
  • fp16 - Armv8.2-A half-precision floating-point extension. See Floating-point extensions for more information.
  • fp16fml - Half-precision floating-point multiply with add or multiply with subtract extension. Supported in the Armv8.2 and later Application profile architectures, and is optional in Armv8.2-A and Armv8.3-A. See Floating-point extensions for more information.
  • memtag - Armv8.5-A memory tagging extension.
  • profile - Armv8.2-A statistical profiling extension.
  • ras - Reliability, Availability, and Serviceability extension.
  • rcpc - Release Consistent Processor Consistent extension. This extension applies to Armv8.2 and later Application profile architectures.
  • rng - Armv8.5-A random number generation extension.
  • sha2 - Cryptographic extension. See Cryptographic extensions for more information.
  • sha3 - Cryptographic extension. See Cryptographic extensions for more information.
  • simd - Advanced SIMD extension.
  • sm4 - Cryptographic extension. See Cryptographic extensions for more information.

For targets in AArch32 state, you can specify one or more of the following features if the architecture supports it:

  • crc - CRC extension for architectures Armv8 and above.
  • dotprod - Enables the VSDOT and VUDOT instructions. Supported in Armv8.2 and later Application profile architectures, and is optional in Armv8.2 and Armv8.3.
  • dsp - DSP extension for the Armv8‑M.mainline architecture.
  • fp16 - Armv8.2-A half-precision floating-point extension. See Floating-point extensions for more information.
  • fp16fml - Half-precision floating-point multiply with add or multiply with subtract extension. Supported in the Armv8.2 and later Application profile architectures, and is optional in Armv8.2-A and Armv8.3-A. See Floating-point extensions for more information.
  • ras - Reliability, Availability, and Serviceability extension.

Note

For targets in AArch32 state, you can use -mfpu to specify the support for floating-point, Advanced SIMD, and cryptographic extensions.

Note

There are no software floating-point libraries for targets in AArch64 state. 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 targets in AArch64 state (--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 targets in AArch32 state (--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