1 ; Machine description for AArch64 architecture.
2 ; Copyright (C) 2009-2024 Free Software Foundation, Inc.
3 ; Contributed by ARM Ltd.
5 ; This file is part of GCC.
7 ; GCC is free software; you can redistribute it and/or modify it
8 ; under the terms of the GNU General Public License as published by
9 ; the Free Software Foundation; either version 3, or (at your option)
12 ; GCC is distributed in the hope that it will be useful, but
13 ; WITHOUT ANY WARRANTY; without even the implied warranty of
14 ; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15 ; General Public License for more details.
17 ; You should have received a copy of the GNU General Public License
18 ; along with GCC; see the file COPYING3. If not see
19 ; <http://www.gnu.org/licenses/>.
22 config/aarch64/aarch64-opts.h
25 config/arm/aarch-common.h
28 enum aarch64_processor selected_tune = aarch64_none
31 enum aarch64_arch selected_arch = aarch64_no_arch
34 uint64_t aarch64_asm_isa_flags_0 = 0
37 uint64_t aarch64_asm_isa_flags_1 = 0
40 uint64_t aarch64_isa_flags_0 = 0
43 uint64_t aarch64_isa_flags_1 = 0
46 unsigned aarch_enable_bti = 2
49 enum aarch64_key_type aarch64_ra_sign_key = AARCH64_KEY_A
51 ; The TLS dialect names to use with -mtls-dialect.
54 Name(tls_type) Type(enum aarch64_tls_type)
55 The possible TLS dialects:
58 Enum(tls_type) String(trad) Value(TLS_TRADITIONAL)
61 Enum(tls_type) String(desc) Value(TLS_DESCRIPTORS)
63 ; The code model option names for -mcmodel.
66 Name(cmodel) Type(enum aarch64_code_model)
67 The code model option names for -mcmodel:
70 Enum(cmodel) String(tiny) Value(AARCH64_CMODEL_TINY)
73 Enum(cmodel) String(small) Value(AARCH64_CMODEL_SMALL)
76 Enum(cmodel) String(large) Value(AARCH64_CMODEL_LARGE)
79 Target RejectNegative Mask(BIG_END)
80 Assume target CPU is configured as big endian.
83 Target RejectNegative Mask(GENERAL_REGS_ONLY) Save
84 Generate code which uses only the general registers.
87 Target RejectNegative Joined Var(aarch64_harden_sls_string)
88 Generate code to mitigate against straight line speculation.
90 mfix-cortex-a53-835769
91 Target Var(aarch64_fix_a53_err835769) Init(2) Save
92 Workaround for ARM Cortex-A53 Erratum number 835769.
94 mfix-cortex-a53-843419
95 Target Var(aarch64_fix_a53_err843419) Init(2) Save
96 Workaround for ARM Cortex-A53 Erratum number 843419.
99 Target RejectNegative InverseMask(BIG_END)
100 Assume target CPU is configured as little endian.
103 Target RejectNegative Joined Enum(cmodel) Var(aarch64_cmodel_var) Init(AARCH64_CMODEL_SMALL) Save
104 Specify the code model.
107 Name(tp_reg) Type(enum aarch64_tp_reg)
108 The register used to access the thread pointer:
111 Enum(tp_reg) String(el0) Value(AARCH64_TPIDR_EL0)
114 Enum(tp_reg) String(tpidr_el0) Value(AARCH64_TPIDR_EL0)
117 Enum(tp_reg) String(el1) Value(AARCH64_TPIDR_EL1)
120 Enum(tp_reg) String(tpidr_el1) Value(AARCH64_TPIDR_EL1)
123 Enum(tp_reg) String(el2) Value(AARCH64_TPIDR_EL2)
126 Enum(tp_reg) String(tpidr_el2) Value(AARCH64_TPIDR_EL2)
129 Enum(tp_reg) String(el3) Value(AARCH64_TPIDR_EL3)
132 Enum(tp_reg) String(tpidr_el3) Value(AARCH64_TPIDR_EL3)
135 Enum(tp_reg) String(tpidrro_el0) Value(AARCH64_TPIDRRO_EL0)
138 Target RejectNegative Joined Enum(tp_reg) Var(aarch64_tpidr_reg) Init(AARCH64_TPIDR_EL0) Save
139 Specify the thread pointer register.
142 Target Mask(STRICT_ALIGN) Save
143 Don't assume that unaligned accesses are handled by the system.
145 momit-leaf-frame-pointer
146 Target Var(flag_omit_leaf_frame_pointer) Init(2) Save
147 Omit the frame pointer in leaf functions.
150 Target RejectNegative Joined Enum(tls_type) Var(aarch64_tls_dialect) Init(TLS_DESCRIPTORS) Save
154 Target RejectNegative Joined Var(aarch64_tls_size) Enum(aarch64_tls_size)
155 Specifies bit size of immediate TLS offsets. Valid values are 12, 24, 32, 48.
158 Name(aarch64_tls_size) Type(int)
161 Enum(aarch64_tls_size) String(12) Value(12)
164 Enum(aarch64_tls_size) String(24) Value(24)
167 Enum(aarch64_tls_size) String(32) Value(32)
170 Enum(aarch64_tls_size) String(48) Value(48)
173 Target RejectNegative Negative(march=) ToLower Joined Var(aarch64_arch_string)
174 Use features of architecture ARCH.
177 Target RejectNegative Negative(mcpu=) ToLower Joined Var(aarch64_cpu_string)
178 Use features of and optimize for CPU.
181 Target RejectNegative Negative(mtune=) ToLower Joined Var(aarch64_tune_string)
185 Target RejectNegative Joined Enum(aarch64_abi) Var(aarch64_abi) Init(AARCH64_ABI_DEFAULT)
186 Generate code that conforms to the specified ABI.
189 Target RejectNegative ToLower Joined Var(aarch64_override_tune_string) Save
190 -moverride=<string> Power users only! Override CPU optimization parameters.
193 Name(aarch64_abi) Type(int)
194 Known AArch64 ABIs (for use with the -mabi= option):
197 Enum(aarch64_abi) String(ilp32) Value(AARCH64_ABI_ILP32)
200 Enum(aarch64_abi) String(lp64) Value(AARCH64_ABI_LP64)
202 mpc-relative-literal-loads
203 Target Save Var(pcrelative_literal_loads) Init(2) Save
204 PC relative literal loads.
207 Target RejectNegative Joined Var(aarch64_branch_protection_string) Save
208 Use branch-protection features.
210 msign-return-address=
211 Target WarnRemoved RejectNegative Joined Enum(aarch_ra_sign_scope_t) Var(aarch_ra_sign_scope) Init(AARCH_FUNCTION_NONE) Save
212 Select return address signing scope.
215 Name(aarch_ra_sign_scope_t) Type(enum aarch_function_type)
216 Supported AArch64 return address signing scope (for use with -msign-return-address= option):
219 Enum(aarch_ra_sign_scope_t) String(none) Value(AARCH_FUNCTION_NONE)
222 Enum(aarch_ra_sign_scope_t) String(non-leaf) Value(AARCH_FUNCTION_NON_LEAF)
225 Enum(aarch_ra_sign_scope_t) String(all) Value(AARCH_FUNCTION_ALL)
227 mlow-precision-recip-sqrt
228 Target Var(flag_mrecip_low_precision_sqrt) Optimization
229 Enable the reciprocal square root approximation. Enabling this reduces
230 precision of reciprocal square root results to about 16 bits for
231 single precision and to 32 bits for double precision.
234 Target Var(flag_mlow_precision_sqrt) Optimization
235 Enable the square root approximation. Enabling this reduces
236 precision of square root results to about 16 bits for
237 single precision and to 32 bits for double precision.
238 If enabled, it implies -mlow-precision-recip-sqrt.
241 Target Var(flag_mlow_precision_div) Optimization
242 Enable the division approximation. Enabling this reduces
243 precision of division results to about 16 bits for
244 single precision and to 32 bits for double precision.
247 Name(early_ra_scope) Type(enum aarch64_early_ra_scope)
250 Enum(early_ra_scope) String(all) Value(AARCH64_EARLY_RA_ALL)
253 Enum(early_ra_scope) String(strided) Value(AARCH64_EARLY_RA_STRIDED)
256 Enum(early_ra_scope) String(none) Value(AARCH64_EARLY_RA_NONE)
259 Target RejectNegative Joined Enum(early_ra_scope) Var(aarch64_early_ra) Init(AARCH64_EARLY_RA_NONE) Optimization
260 Specify when to enable an early register allocation pass. The possibilities
261 are: all functions, functions that have access to strided multi-register
262 instructions, and no functions.
265 Name(sve_vector_bits) Type(enum aarch64_sve_vector_bits_enum)
266 The possible SVE vector lengths:
269 Enum(sve_vector_bits) String(scalable) Value(SVE_SCALABLE)
272 Enum(sve_vector_bits) String(128) Value(SVE_128)
275 Enum(sve_vector_bits) String(256) Value(SVE_256)
278 Enum(sve_vector_bits) String(512) Value(SVE_512)
281 Enum(sve_vector_bits) String(1024) Value(SVE_1024)
284 Enum(sve_vector_bits) String(2048) Value(SVE_2048)
287 Target RejectNegative Joined Enum(sve_vector_bits) Var(aarch64_sve_vector_bits) Init(SVE_SCALABLE)
288 -msve-vector-bits=<number> Set the number of bits in an SVE vector register.
291 Target Undocumented Var(flag_aarch64_verbose_cost)
292 Enables verbose cost model dumping in the debug dump files.
295 Target Var(aarch64_track_speculation)
296 Generate code to track when the CPU might be speculating incorrectly.
299 Target Var(flag_aarch64_early_ldp_fusion) Optimization Init(1)
300 Enable the copy of the AArch64 load/store pair fusion pass that runs before
304 Target Var(flag_aarch64_late_ldp_fusion) Optimization Init(1)
305 Enable the copy of the AArch64 load/store pair fusion pass that runs after
308 mstack-protector-guard=
309 Target RejectNegative Joined Enum(stack_protector_guard) Var(aarch64_stack_protector_guard) Init(SSP_GLOBAL)
310 Use given stack-protector guard.
313 Name(stack_protector_guard) Type(enum stack_protector_guard)
314 Valid arguments to -mstack-protector-guard=:
317 Enum(stack_protector_guard) String(sysreg) Value(SSP_SYSREG)
320 Enum(stack_protector_guard) String(global) Value(SSP_GLOBAL)
322 mstack-protector-guard-reg=
323 Target Joined RejectNegative String Var(aarch64_stack_protector_guard_reg_str)
324 Use the system register specified on the command line as the stack protector
325 guard register. This option is for use with fstack-protector-strong and
326 not for use in user-land code.
328 mstack-protector-guard-offset=
329 Target Joined RejectNegative String Var(aarch64_stack_protector_guard_offset_str)
330 Use an immediate to offset from the stack protector guard register, sp_el0.
331 This option is for use with fstack-protector-strong and not for use in
335 long aarch64_stack_protector_guard_offset = 0
338 Target Var(aarch64_flag_outline_atomics) Init(2) Save
339 Generate local calls to out-of-line atomic operations.
341 -param=aarch64-vect-compare-costs=
342 Target Joined UInteger Var(aarch64_vect_compare_costs) Init(1) IntegerRange(0, 1) Param
343 When vectorizing, consider using multiple different approaches and use
344 the cost model to choose the cheapest one.
346 -param=aarch64-float-recp-precision=
347 Target Joined UInteger Var(aarch64_float_recp_precision) Init(1) IntegerRange(1, 5) Param
348 The number of Newton iterations for calculating the reciprocal for float type. The precision of division is proportional to this param when division approximation is enabled. The default value is 1.
350 -param=aarch64-double-recp-precision=
351 Target Joined UInteger Var(aarch64_double_recp_precision) Init(2) IntegerRange(1, 5) Param
352 The number of Newton iterations for calculating the reciprocal for double type. The precision of division is proportional to this param when division approximation is enabled. The default value is 2.
354 -param=aarch64-autovec-preference=
355 Target Joined Var(aarch64_autovec_preference) Enum(aarch64_autovec_preference) Init(AARCH64_AUTOVEC_DEFAULT) Param
356 --param=aarch64-autovec-preference=[default|asimd-only|sve-only|prefer-asimd|prefer-sve]
357 Force an ISA selection strategy for auto-vectorization.
360 Name(aarch64_autovec_preference) Type(enum aarch64_autovec_preference_enum) UnknownError(unknown autovec preference %qs)
363 Enum(aarch64_autovec_preference) String(default) Value(AARCH64_AUTOVEC_DEFAULT)
366 Enum(aarch64_autovec_preference) String(asimd-only) Value(AARCH64_AUTOVEC_ASIMD_ONLY)
369 Enum(aarch64_autovec_preference) String(sve-only) Value(AARCH64_AUTOVEC_SVE_ONLY)
372 Enum(aarch64_autovec_preference) String(prefer-asimd) Value(AARCH64_AUTOVEC_PREFER_ASIMD)
375 Enum(aarch64_autovec_preference) String(prefer-sve) Value(AARCH64_AUTOVEC_PREFER_SVE)
377 -param=aarch64-loop-vect-issue-rate-niters=
378 Target Joined UInteger Var(aarch64_loop_vect_issue_rate_niters) Init(6) IntegerRange(0, 65536) Param
380 -param=aarch64-mops-memcpy-size-threshold=
381 Target Joined UInteger Var(aarch64_mops_memcpy_size_threshold) Init(256) Param
382 Constant memcpy size in bytes above which to start using MOPS sequence.
384 -param=aarch64-mops-memmove-size-threshold=
385 Target Joined UInteger Var(aarch64_mops_memmove_size_threshold) Init(256) Param
386 Constant memmove size in bytes above which to start using MOPS sequence.
388 -param=aarch64-mops-memset-size-threshold=
389 Target Joined UInteger Var(aarch64_mops_memset_size_threshold) Init(256) Param
390 Constant memset size in bytes from which to start using MOPS sequence.
392 -param=aarch64-vect-unroll-limit=
393 Target Joined UInteger Var(aarch64_vect_unroll_limit) Init(4) Param
394 Limit how much the autovectorizer may unroll a loop.
396 -param=aarch64-ldp-policy=
397 Target Joined Var(aarch64_ldp_policy_param) Enum(aarch64_ldp_stp_policy) Init(AARCH64_LDP_STP_POLICY_DEFAULT) Param
398 --param=aarch64-ldp-policy=[default|always|never|aligned] Fine-grained policy for load pairs.
400 -param=aarch64-stp-policy=
401 Target Joined Var(aarch64_stp_policy_param) Enum(aarch64_ldp_stp_policy) Init(AARCH64_LDP_STP_POLICY_DEFAULT) Param
402 --param=aarch64-stp-policy=[default|always|never|aligned] Fine-grained policy for store pairs.
405 Name(aarch64_ldp_stp_policy) Type(enum aarch64_ldp_stp_policy) UnknownError(unknown LDP/STP policy %qs)
408 Enum(aarch64_ldp_stp_policy) String(default) Value(AARCH64_LDP_STP_POLICY_DEFAULT)
411 Enum(aarch64_ldp_stp_policy) String(always) Value(AARCH64_LDP_STP_POLICY_ALWAYS)
414 Enum(aarch64_ldp_stp_policy) String(never) Value(AARCH64_LDP_STP_POLICY_NEVER)
417 Enum(aarch64_ldp_stp_policy) String(aligned) Value(AARCH64_LDP_STP_POLICY_ALIGNED)
419 -param=aarch64-ldp-alias-check-limit=
420 Target Joined UInteger Var(aarch64_ldp_alias_check_limit) Init(8) IntegerRange(0, 65536) Param
421 Limit on number of alias checks performed when attempting to form an ldp/stp.
423 -param=aarch64-ldp-writeback=
424 Target Joined UInteger Var(aarch64_ldp_writeback) Init(2) IntegerRange(0,2) Param
425 Param to control which writeback opportunities we try to handle in the
426 load/store pair fusion pass. A value of zero disables writeback
427 handling. One means we try to form pairs involving one or more existing
428 individual writeback accesses where possible. A value of two means we
429 also try to opportunistically form writeback opportunities by folding in
430 trailing destructive updates of the base register used by a pair.