]> git.ipfire.org Git - thirdparty/gcc.git/blame - gcc/config/aarch64/aarch64-option-extensions.def
Update copyright years.
[thirdparty/gcc.git] / gcc / config / aarch64 / aarch64-option-extensions.def
CommitLineData
99dee823 1/* Copyright (C) 2012-2021 Free Software Foundation, Inc.
43e9d192
IB
2 Contributed by ARM Ltd.
3
4 This file is part of GCC.
5
6 GCC is free software; you can redistribute it and/or modify it
7 under the terms of the GNU General Public License as published by
8 the Free Software Foundation; either version 3, or (at your option)
9 any later version.
10
11 GCC is distributed in the hope that it will be useful, but
12 WITHOUT ANY WARRANTY; without even the implied warranty of
13 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 General Public License for more details.
15
16 You should have received a copy of the GNU General Public License
17 along with GCC; see the file COPYING3. If not see
18 <http://www.gnu.org/licenses/>. */
19
20/* This is a list of ISA extentsions in AArch64.
21
22 Before using #include to read this file, define a macro:
23
4ca82fc9
TC
24 AARCH64_OPT_EXTENSION(EXT_NAME, FLAG_CANONICAL, FLAGS_ON, FLAGS_OFF,
25 SYNTHETIC, FEATURE_STRING)
26
27 - EXT_NAME is the name of the extension, represented as a string constant.
28 - FLAGS_CANONICAL is the canonical internal name for this flag.
29 - FLAGS_ON are the bitwise-or of the features that enabling the extension
30 adds, or zero if enabling this extension has no effect on other features.
31 - FLAGS_OFF are the bitwise-or of the features that disabling the extension
32 removes, or zero if disabling this extension has no effect on other
33 features.
34 - SYNTHETIC is a boolean to indicate whether the option is a purely synthetic
35 grouping of options and that the option itself has no feature bit (e.g.
36 crypto). This is used to determine when sum of the individual options in
37 FLAGS_ON can be replaced by FLAG_CANONICAL in options minimization. If the
38 group is synthetic then they can be replaced when all options in FLAGS_ON
39 are enabled, otherwise they can only be replaced when
40 FLAGS_ON | FLAG_CANONICAL are enabled.
41 - FEAT_STRING is a string containing the entries in the 'Features' field of
42 /proc/cpuinfo on a GNU/Linux system that correspond to this architecture
43 extension being available. Sometimes multiple entries are needed to enable
44 the extension (for example, the 'crypto' extension depends on four
45 entries: aes, pmull, sha1, sha2 being present). In that case this field
46 should contain a space (" ") separated list of the strings in 'Features'
29c6debc 47 that are required. Their order is not important. An empty string means
3644cadf 48 do not detect this feature during auto detection.
43e9d192 49
3644cadf
TC
50 NOTE: Any changes to the AARCH64_OPT_EXTENSION macro need to be mirrored in
51 config.gcc. */
1ccd8493 52
04a99ebe 53/* Enabling "fp" just enables "fp".
43cacb12 54 Disabling "fp" also disables "simd", "crypto", "fp16", "aes", "sha2",
a93e1d5c 55 "sha3", sm3/sm4, "sve", "sve2", "sve2-aes", "sve2-sha3", "sve2-sm4",
36696774 56 "sve2-bitperm", "i8mm", "f32mm", "f64mm", and "bf16". */
3644cadf
TC
57AARCH64_OPT_EXTENSION("fp", AARCH64_FL_FP, 0, AARCH64_FL_SIMD | \
58 AARCH64_FL_CRYPTO | AARCH64_FL_F16 | AARCH64_FL_AES | \
59 AARCH64_FL_SHA2 | AARCH64_FL_SHA3 | AARCH64_FL_SM4 | \
60 AARCH64_FL_SVE | AARCH64_FL_SVE2 | AARCH64_FL_SVE2_AES | \
61 AARCH64_FL_SVE2_SHA3 | AARCH64_FL_SVE2_SM4 | \
a93e1d5c 62 AARCH64_FL_SVE2_BITPERM | AARCH64_FL_I8MM | \
36696774
RS
63 AARCH64_FL_F32MM | AARCH64_FL_F64MM | AARCH64_FL_BF16,
64 false, "fp")
04a99ebe
JG
65
66/* Enabling "simd" also enables "fp".
43cacb12 67 Disabling "simd" also disables "crypto", "dotprod", "aes", "sha2", "sha3",
a93e1d5c 68 "sm3/sm4", "sve", "sve2", "sve2-aes", "sve2-sha3", "sve2-sm4",
36696774 69 "sve2-bitperm", "i8mm", "f32mm" and "f64mm". */
3644cadf
TC
70AARCH64_OPT_EXTENSION("simd", AARCH64_FL_SIMD, AARCH64_FL_FP, \
71 AARCH64_FL_CRYPTO | AARCH64_FL_DOTPROD | \
72 AARCH64_FL_AES | AARCH64_FL_SHA2 | AARCH64_FL_SHA3 | \
73 AARCH64_FL_SM4 | AARCH64_FL_SVE | AARCH64_FL_SVE2 | \
74 AARCH64_FL_SVE2_AES | AARCH64_FL_SVE2_SHA3 | \
a93e1d5c 75 AARCH64_FL_SVE2_SM4 | AARCH64_FL_SVE2_BITPERM | \
36696774
RS
76 AARCH64_FL_I8MM | AARCH64_FL_F32MM | AARCH64_FL_F64MM, \
77 false, "asimd")
04a99ebe 78
4ca82fc9 79/* Enabling "crypto" also enables "fp", "simd", "aes" and "sha2".
28108a53
MM
80 Disabling "crypto" disables "crypto", "aes", "sha2", "sha3" and "sm3/sm4",
81 "sve2-aes", "sve2-sha3", "sve2-sm4". */
3644cadf
TC
82AARCH64_OPT_EXTENSION("crypto", AARCH64_FL_CRYPTO, AARCH64_FL_FP | \
83 AARCH64_FL_SIMD | AARCH64_FL_AES | AARCH64_FL_SHA2, \
84 AARCH64_FL_AES | AARCH64_FL_SHA2 | AARCH64_FL_SHA3 | \
85 AARCH64_FL_SM4 | AARCH64_FL_SVE2_AES | \
86 AARCH64_FL_SVE2_SHA3 | AARCH64_FL_SVE2_SM4, true, \
87 "aes pmull sha1 sha2")
04a99ebe
JG
88
89/* Enabling or disabling "crc" only changes "crc". */
4ca82fc9 90AARCH64_OPT_EXTENSION("crc", AARCH64_FL_CRC, 0, 0, false, "crc32")
04a99ebe
JG
91
92/* Enabling or disabling "lse" only changes "lse". */
4ca82fc9 93AARCH64_OPT_EXTENSION("lse", AARCH64_FL_LSE, 0, 0, false, "atomics")
c61465bd
MW
94
95/* Enabling "fp16" also enables "fp".
336e1b95 96 Disabling "fp16" disables "fp16", "fp16fml", "sve", "sve2",
36696774
RS
97 "sve2-aes", "sve2-sha3", "sve2-sm4", "sve2-bitperm", "f32mm" and
98 "f64mm". */
3644cadf 99AARCH64_OPT_EXTENSION("fp16", AARCH64_FL_F16, AARCH64_FL_FP, \
36696774
RS
100 AARCH64_FL_F16FML | AARCH64_FL_SVE | AARCH64_FL_F32MM | \
101 AARCH64_FL_F64MM | AARCH64_FL_SVE2 | \
102 AARCH64_FL_SVE2_AES | AARCH64_FL_SVE2_SHA3 | \
103 AARCH64_FL_SVE2_SM4 | AARCH64_FL_SVE2_BITPERM, false, \
3644cadf 104 "fphp asimdhp")
cd8b19af 105
78295eff 106/* Enabling or disabling "rcpc" only changes "rcpc". */
4ca82fc9 107AARCH64_OPT_EXTENSION("rcpc", AARCH64_FL_RCPC, 0, 0, false, "lrcpc")
78295eff 108
43f84f6c
JW
109/* Enabling "rdma" also enables "fp", "simd".
110 Disabling "rdma" just disables "rdma". */
3644cadf
TC
111AARCH64_OPT_EXTENSION("rdma", AARCH64_FL_RDMA, \
112 AARCH64_FL_FP | AARCH64_FL_SIMD, 0, false, "asimdrdm")
43f84f6c 113
1ddc47c0
TC
114/* Enabling "dotprod" also enables "simd".
115 Disabling "dotprod" only disables "dotprod". */
3644cadf
TC
116AARCH64_OPT_EXTENSION("dotprod", AARCH64_FL_DOTPROD, AARCH64_FL_SIMD, 0, \
117 false, "asimddp")
1ddc47c0 118
27086ea3 119/* Enabling "aes" also enables "simd".
28108a53 120 Disabling "aes" disables "aes" and "sve2-aes'. */
3644cadf
TC
121AARCH64_OPT_EXTENSION("aes", AARCH64_FL_AES, AARCH64_FL_SIMD, \
122 AARCH64_FL_SVE2_AES, false, "aes")
27086ea3
MC
123
124/* Enabling "sha2" also enables "simd".
125 Disabling "sha2" just disables "sha2". */
3644cadf
TC
126AARCH64_OPT_EXTENSION("sha2", AARCH64_FL_SHA2, AARCH64_FL_SIMD, 0, false, \
127 "sha1 sha2")
27086ea3
MC
128
129/* Enabling "sha3" enables "simd" and "sha2".
28108a53 130 Disabling "sha3" disables "sha3" and "sve2-sha3". */
3644cadf
TC
131AARCH64_OPT_EXTENSION("sha3", AARCH64_FL_SHA3, AARCH64_FL_SIMD | \
132 AARCH64_FL_SHA2, AARCH64_FL_SVE2_SHA3, false, \
133 "sha3 sha512")
27086ea3
MC
134
135/* Enabling "sm4" also enables "simd".
28108a53 136 Disabling "sm4" disables "sm4" and "sve2-sm4". */
3644cadf
TC
137AARCH64_OPT_EXTENSION("sm4", AARCH64_FL_SM4, AARCH64_FL_SIMD, \
138 AARCH64_FL_SVE2_SM4, false, "sm3 sm4")
27086ea3
MC
139
140/* Enabling "fp16fml" also enables "fp" and "fp16".
141 Disabling "fp16fml" just disables "fp16fml". */
3644cadf 142AARCH64_OPT_EXTENSION("fp16fml", AARCH64_FL_F16FML, \
937960df 143 AARCH64_FL_FP | AARCH64_FL_F16, 0, false, "asimdfhm")
27086ea3 144
43cacb12 145/* Enabling "sve" also enables "fp16", "fp" and "simd".
36696774
RS
146 Disabling "sve" disables "sve", "f32mm", "f64mm", "sve2", "sve2-aes",
147 "sve2-sha3", "sve2-sm4" and "sve2-bitperm". */
3644cadf 148AARCH64_OPT_EXTENSION("sve", AARCH64_FL_SVE, AARCH64_FL_FP | AARCH64_FL_SIMD | \
36696774
RS
149 AARCH64_FL_F16, AARCH64_FL_F32MM | AARCH64_FL_F64MM | \
150 AARCH64_FL_SVE2 | AARCH64_FL_SVE2_AES | \
151 AARCH64_FL_SVE2_SHA3 | AARCH64_FL_SVE2_SM4 | \
152 AARCH64_FL_SVE2_BITPERM, false, "sve")
43cacb12 153
5170e47e 154/* Enabling/Disabling "profile" does not enable/disable any other feature. */
4ca82fc9 155AARCH64_OPT_EXTENSION("profile", AARCH64_FL_PROFILE, 0, 0, false, "")
5170e47e 156
9b4247de 157/* Enabling/Disabling "rng" only changes "rng". */
0d8f3f61 158AARCH64_OPT_EXTENSION("rng", AARCH64_FL_RNG, 0, 0, false, "rng")
9b4247de
SD
159
160/* Enabling/Disabling "memtag" only changes "memtag". */
4ca82fc9 161AARCH64_OPT_EXTENSION("memtag", AARCH64_FL_MEMTAG, 0, 0, false, "")
9b4247de
SD
162
163/* Enabling/Disabling "sb" only changes "sb". */
75f93536 164AARCH64_OPT_EXTENSION("sb", AARCH64_FL_SB, 0, 0, false, "sb")
9b4247de
SD
165
166/* Enabling/Disabling "ssbs" only changes "ssbs". */
75f93536 167AARCH64_OPT_EXTENSION("ssbs", AARCH64_FL_SSBS, 0, 0, false, "ssbs")
9b4247de
SD
168
169/* Enabling/Disabling "predres" only changes "predres". */
4ca82fc9 170AARCH64_OPT_EXTENSION("predres", AARCH64_FL_PREDRES, 0, 0, false, "")
9b4247de 171
28108a53
MM
172/* Enabling "sve2" also enables "sve", "fp16", "fp", and "simd".
173 Disabling "sve2" disables "sve2", "sve2-aes", "sve2-sha3", "sve2-sm4", and
c10abf53 174 "sve2-bitperm". */
3644cadf
TC
175AARCH64_OPT_EXTENSION("sve2", AARCH64_FL_SVE2, AARCH64_FL_SVE | \
176 AARCH64_FL_FP | AARCH64_FL_SIMD | AARCH64_FL_F16, \
177 AARCH64_FL_SVE2_AES | AARCH64_FL_SVE2_SHA3 | \
75f93536 178 AARCH64_FL_SVE2_SM4 | AARCH64_FL_SVE2_BITPERM, false, "sve2")
28108a53
MM
179
180/* Enabling "sve2-sm4" also enables "sm4", "simd", "fp16", "fp", "sve", and
181 "sve2". Disabling "sve2-sm4" just disables "sve2-sm4". */
3644cadf
TC
182AARCH64_OPT_EXTENSION("sve2-sm4", AARCH64_FL_SVE2_SM4, AARCH64_FL_SM4 | \
183 AARCH64_FL_SIMD | AARCH64_FL_F16 | AARCH64_FL_FP | \
75f93536 184 AARCH64_FL_SVE | AARCH64_FL_SVE2, 0, false, "svesm4")
28108a53
MM
185
186/* Enabling "sve2-aes" also enables "aes", "simd", "fp16", "fp", "sve", and
187 "sve2". Disabling "sve2-aes" just disables "sve2-aes". */
3644cadf
TC
188AARCH64_OPT_EXTENSION("sve2-aes", AARCH64_FL_SVE2_AES, AARCH64_FL_AES | \
189 AARCH64_FL_SIMD | AARCH64_FL_F16 | AARCH64_FL_FP | \
75f93536 190 AARCH64_FL_SVE | AARCH64_FL_SVE2, 0, false, "sveaes")
28108a53
MM
191
192/* Enabling "sve2-sha3" also enables "sha3", "simd", "fp16", "fp", "sve", and
193 "sve2". Disabling "sve2-sha3" just disables "sve2-sha3". */
3644cadf
TC
194AARCH64_OPT_EXTENSION("sve2-sha3", AARCH64_FL_SVE2_SHA3, AARCH64_FL_SHA3 | \
195 AARCH64_FL_SIMD | AARCH64_FL_F16 | AARCH64_FL_FP | \
75f93536 196 AARCH64_FL_SVE | AARCH64_FL_SVE2, 0, false, "svesha3")
28108a53 197
c10abf53
RS
198/* Enabling "sve2-bitperm" also enables "simd", "fp16", "fp", "sve", and
199 "sve2". Disabling "sve2-bitperm" just disables "sve2-bitperm". */
3644cadf
TC
200AARCH64_OPT_EXTENSION("sve2-bitperm", AARCH64_FL_SVE2_BITPERM, AARCH64_FL_SIMD | \
201 AARCH64_FL_F16 | AARCH64_FL_FP | AARCH64_FL_SVE | \
75f93536 202 AARCH64_FL_SVE2, 0, false, "svebitperm")
28108a53 203
89626179
SD
204/* Enabling or disabling "tme" only changes "tme". */
205AARCH64_OPT_EXTENSION("tme", AARCH64_FL_TME, 0, 0, false, "")
206
a93e1d5c
DZ
207/* Enabling "i8mm" also enables "simd" and "fp".
208 Disabling "i8mm" only disables "i8mm". */
209AARCH64_OPT_EXTENSION("i8mm", AARCH64_FL_I8MM, \
210 AARCH64_FL_SIMD | AARCH64_FL_FP, 0, false, "i8mm")
211
36696774
RS
212/* Enabling "f32mm" also enables "sve", "fp16", "fp", and "simd".
213 Disabling "f32mm" only disables "f32mm". */
214AARCH64_OPT_EXTENSION("f32mm", AARCH64_FL_F32MM, \
215 AARCH64_FL_SVE | AARCH64_FL_F16 | AARCH64_FL_FP | \
216 AARCH64_FL_SIMD, 0, false, "f32mm")
217
336e1b95
MM
218/* Enabling "f64mm" also enables "sve", "fp16", "fp", and "simd".
219 Disabling "f64mm" only disables "f64mm". */
220AARCH64_OPT_EXTENSION("f64mm", AARCH64_FL_F64MM, \
221 AARCH64_FL_SVE | AARCH64_FL_F16 | AARCH64_FL_FP | \
222 AARCH64_FL_SIMD, 0, false, "f64mm")
223
a93e1d5c
DZ
224/* Enabling "bf16" also enables "simd" and "fp".
225 Disabling "bf16" only disables "bf16". */
226AARCH64_OPT_EXTENSION("bf16", AARCH64_FL_BF16, \
227 AARCH64_FL_SIMD | AARCH64_FL_FP, 0, false, "bf16")
228
48ff86ad
PW
229/* Enabling/Disabling "flagm" only changes "flagm". */
230AARCH64_OPT_EXTENSION("flagm", AARCH64_FL_FLAGM, 0, 0, false, "flagm")
231
ef33047a
PW
232/* Enabling/Disabling "pauth" only changes "pauth". */
233AARCH64_OPT_EXTENSION("pauth", AARCH64_FL_PAUTH, 0, 0, false, "paca pacg")
234
cd8b19af 235#undef AARCH64_OPT_EXTENSION