1 /* Machine description for AArch64 architecture.
2 Copyright (C) 2009-2025 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/>. */
21 #ifndef GCC_AARCH64_ERRATA_H
22 #define GCC_AARCH64_ERRATA_H
24 /* Completely ignore the option if we've explicitly specify something other than
25 mcpu=cortex-a53 or march=armv8-a. */
26 #define TARGET_SUPPRESS_OPT_SPEC(OPT) \
27 "mcpu=*:%{%:is_local_not_armv8_base(%{mcpu=*:%*}):; " OPT \
28 "}; march=*:%{%:is_local_not_armv8_base(%{march=*:%*}):;" OPT "}; " OPT
30 /* Explicitly turn off the option if we've explicitly specify something other
31 than mcpu=cortex-a53 or march=armv8-a. This will also erase any other usage
32 of the flag making the order of the options not relevant. */
33 # define TARGET_TURN_OFF_OPT_SPEC(FLAG) \
34 "mcpu=*:%{%:is_local_not_armv8_base(%{mcpu=*:%*}):%<m" FLAG " -mno-" FLAG \
35 "}; march=*:%{%:is_local_not_armv8_base(%{march=*:%*}):%<m" FLAG " -mno-" FLAG "}"
37 /* Cortex-A53 835769 Errata. */
39 #if TARGET_FIX_ERR_A53_835769_DEFAULT
40 #define CA53_ERR_835769_SPEC \
42 TARGET_SUPPRESS_OPT_SPEC ("!mno-fix-cortex-a53-835769:--fix-cortex-a53-835769") \
45 #define CA53_ERR_835769_SPEC \
47 TARGET_SUPPRESS_OPT_SPEC ("mfix-cortex-a53-835769:--fix-cortex-a53-835769") \
51 #define CA53_ERR_835769_COMPILE_SPEC \
52 " %{" TARGET_TURN_OFF_OPT_SPEC ("fix-cortex-a53-835769") "}"
54 /* Cortex-A53 843419 Errata. */
56 #if TARGET_FIX_ERR_A53_843419_DEFAULT
57 #define CA53_ERR_843419_SPEC \
59 TARGET_SUPPRESS_OPT_SPEC ("!mno-fix-cortex-a53-843419:--fix-cortex-a53-843419") \
62 #define CA53_ERR_843419_SPEC \
64 TARGET_SUPPRESS_OPT_SPEC ("mfix-cortex-a53-843419:--fix-cortex-a53-843419") \
68 #define CA53_ERR_843419_COMPILE_SPEC \
69 " %{" TARGET_TURN_OFF_OPT_SPEC ("fix-cortex-a53-843419") "}"
71 /* Exports to use in SPEC files. */
73 #define AARCH64_ERRATA_LINK_SPEC \
74 CA53_ERR_835769_SPEC \
77 #define AARCH64_ERRATA_COMPILE_SPEC \
78 CA53_ERR_835769_COMPILE_SPEC \
79 CA53_ERR_843419_COMPILE_SPEC
81 #endif /* GCC_AARCH64_ERRATA_H */