Next: , Up: Submodel Options


3.17.1 AArch64 Options

These options are defined for AArch64 implementations:

-mabi=name
Generate code for the specified data model. Permissible values are ‘ilp32’ for SysV-like data model where int, long int and pointer are 32-bit, and ‘lp64’ for SysV-like data model where int is 32-bit, but long int and pointer are 64-bit.

The default depends on the specific target configuration. Note that the LP64 and ILP32 ABIs are not link-compatible; you must compile your entire program with the same ABI, and link with a compatible set of libraries.

-mbig-endian
Generate big-endian code. This is the default when GCC is configured for an ‘aarch64_be-*-*’ target.
-mgeneral-regs-only
Generate code which uses only the general-purpose registers. This is equivalent to feature modifier nofp of -march or -mcpu, except that -mgeneral-regs-only takes precedence over any conflicting feature modifier regardless of sequence.
-mlittle-endian
Generate little-endian code. This is the default when GCC is configured for an ‘aarch64-*-*’ but not an ‘aarch64_be-*-*’ target.
-mcmodel=tiny
Generate code for the tiny code model. The program and its statically defined symbols must be within 1GB of each other. Pointers are 64 bits. Programs can be statically or dynamically linked. This model is not fully implemented and mostly treated as ‘small’.
-mcmodel=small
Generate code for the small code model. The program and its statically defined symbols must be within 4GB of each other. Pointers are 64 bits. Programs can be statically or dynamically linked. This is the default code model.
-mcmodel=large
Generate code for the large code model. This makes no assumptions about addresses and sizes of sections. Pointers are 64 bits. Programs can be statically linked only.
-mstrict-align
Do not assume that unaligned memory references are handled by the system.
-momit-leaf-frame-pointer
-mno-omit-leaf-frame-pointer
Omit or keep the frame pointer in leaf functions. The former behaviour is the default.
-mtls-dialect=desc
Use TLS descriptors as the thread-local storage mechanism for dynamic accesses of TLS variables. This is the default.
-mtls-dialect=traditional
Use traditional TLS as the thread-local storage mechanism for dynamic accesses of TLS variables.
-mfix-cortex-a53-835769
-mno-fix-cortex-a53-835769
Enable or disable the workaround for the ARM Cortex-A53 erratum number 835769. This involves inserting a NOP instruction between memory instructions and 64-bit integer multiply-accumulate instructions.
-mfix-cortex-a53-843419
-mno-fix-cortex-a53-843419
Enable or disable the workaround for the ARM Cortex-A53 erratum number 843419. This erratum workaround is made at link time and this will only pass the corresponding flag to the linker.
-march=name
Specify the name of the target architecture, optionally suffixed by one or more feature modifiers. This option has the form -march=arch{+[no]feature}*.

The permissible values for arch are ‘armv8-a’ or ‘armv8.1-a’.

For the permissible values for feature, see the sub-section on -march and -mcpu Feature Modifiers. Where conflicting feature modifiers are specified, the right-most feature is used.

Additionally on native AArch64 GNU/Linux systems the value ‘native’ is available. This option causes the compiler to pick the architecture of the host system. If the compiler is unable to recognize the architecture of the host system this option has no effect.

GCC uses name to determine what kind of instructions it can emit when generating assembly code. If -march is specified without either of -mtune or -mcpu also being specified, the code is tuned to perform well across a range of target processors implementing the target architecture.

-mtune=name
Specify the name of the target processor for which GCC should tune the performance of the code. Permissible values for this option are: ‘generic’, ‘cortex-a53’, ‘cortex-a57’, ‘cortex-a72’, ‘exynos-m1’, ‘thunderx’, ‘xgene1’.

Additionally, this option can specify that GCC should tune the performance of the code for a big.LITTLE system. Permissible values for this option are: ‘cortex-a57.cortex-a53’, ‘cortex-a72.cortex-a53’.

Additionally on native AArch64 GNU/Linux systems the value ‘native’ is available. This option causes the compiler to pick the architecture of and tune the performance of the code for the processor of the host system. If the compiler is unable to recognize the processor of the host system this option has no effect.

Where none of -mtune=, -mcpu= or -march= are specified, the code is tuned to perform well across a range of target processors.

This option cannot be suffixed by feature modifiers.

-mcpu=name
Specify the name of the target processor, optionally suffixed by one or more feature modifiers. This option has the form -mcpu=cpu{+[no]feature}*, where the permissible values for cpu are the same as those available for -mtune. The permissible values for feature are documented in the sub-section on -march and -mcpu Feature Modifiers. Where conflicting feature modifiers are specified, the right-most feature is used.

Additionally on native AArch64 GNU/Linux systems the value ‘native’ is available. This option causes the compiler to tune the performance of the code for the processor of the host system. If the compiler is unable to recognize the processor of the host system this option has no effect.

GCC uses name to determine what kind of instructions it can emit when generating assembly code (as if by -march) and to determine the target processor for which to tune for performance (as if by -mtune). Where this option is used in conjunction with -march or -mtune, those options take precedence over the appropriate part of this option.

-moverride=string
Override tuning decisions made by the back-end in response to a -mtune= switch. The syntax, semantics, and accepted values for string in this option are not guaranteed to be consistent across releases.

This option is only intended to be useful when developing GCC.

3.17.1.1 -march and -mcpu Feature Modifiers

Feature modifiers used with -march and -mcpu can be any of the following and their inverses nofeature:

crc
Enable CRC extension.
crypto
Enable Crypto extension. This also enables Advanced SIMD and floating-point instructions.
fp
Enable floating-point instructions. This is on by default for all possible values for options -march and -mcpu.
simd
Enable Advanced SIMD instructions. This also enables floating-point instructions. This is on by default for all possible values for options -march and -mcpu.
lse
Enable Large System Extension instructions.
pan
Enable Privileged Access Never support.
lor
Enable Limited Ordering Regions support.
rdma
Enable ARMv8.1 Advanced SIMD instructions. This implies Advanced SIMD is enabled.

That is, crypto implies simd implies fp. Conversely, nofp (or equivalently, -mgeneral-regs-only) implies nosimd implies nocrypto.