| 1 |
/* Machine description for AArch64 architecture. |
| 2 |
Copyright (C) 2009-2025 Free Software Foundation, Inc. |
| 3 |
Contributed by ARM Ltd. |
| 4 |
|
| 5 |
This file is part of GCC. |
| 6 |
|
| 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) |
| 10 |
any later version. |
| 11 |
|
| 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. |
| 16 |
|
| 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/>. */ |
| 20 |
|
| 21 |
#ifndef GCC_AARCH64_ERRATA_H |
| 22 |
#define GCC_AARCH64_ERRATA_H |
| 23 |
|
| 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 |
| 29 |
|
| 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 "}" |
| 36 |
|
| 37 |
/* Cortex-A53 835769 Errata. */ |
| 38 |
|
| 39 |
#if TARGET_FIX_ERR_A53_835769_DEFAULT |
| 40 |
#define CA53_ERR_835769_SPEC \ |
| 41 |
" %{" \ |
| 42 |
TARGET_SUPPRESS_OPT_SPEC ("!mno-fix-cortex-a53-835769:--fix-cortex-a53-835769") \ |
| 43 |
" }" |
| 44 |
#else |
| 45 |
#define CA53_ERR_835769_SPEC \ |
| 46 |
" %{" \ |
| 47 |
TARGET_SUPPRESS_OPT_SPEC ("mfix-cortex-a53-835769:--fix-cortex-a53-835769") \ |
| 48 |
" }" |
| 49 |
#endif |
| 50 |
|
| 51 |
#define CA53_ERR_835769_COMPILE_SPEC \ |
| 52 |
" %{" TARGET_TURN_OFF_OPT_SPEC ("fix-cortex-a53-835769") "}" |
| 53 |
|
| 54 |
/* Cortex-A53 843419 Errata. */ |
| 55 |
|
| 56 |
#if TARGET_FIX_ERR_A53_843419_DEFAULT |
| 57 |
#define CA53_ERR_843419_SPEC \ |
| 58 |
" %{" \ |
| 59 |
TARGET_SUPPRESS_OPT_SPEC ("!mno-fix-cortex-a53-843419:--fix-cortex-a53-843419") \ |
| 60 |
" }" |
| 61 |
#else |
| 62 |
#define CA53_ERR_843419_SPEC \ |
| 63 |
" %{" \ |
| 64 |
TARGET_SUPPRESS_OPT_SPEC ("mfix-cortex-a53-843419:--fix-cortex-a53-843419") \ |
| 65 |
" }" |
| 66 |
#endif |
| 67 |
|
| 68 |
#define CA53_ERR_843419_COMPILE_SPEC \ |
| 69 |
" %{" TARGET_TURN_OFF_OPT_SPEC ("fix-cortex-a53-843419") "}" |
| 70 |
|
| 71 |
/* Exports to use in SPEC files. */ |
| 72 |
|
| 73 |
#define AARCH64_ERRATA_LINK_SPEC \ |
| 74 |
CA53_ERR_835769_SPEC \ |
| 75 |
CA53_ERR_843419_SPEC |
| 76 |
|
| 77 |
#define AARCH64_ERRATA_COMPILE_SPEC \ |
| 78 |
CA53_ERR_835769_COMPILE_SPEC \ |
| 79 |
CA53_ERR_843419_COMPILE_SPEC |
| 80 |
|
| 81 |
#endif /* GCC_AARCH64_ERRATA_H */ |