]>
Commit | Line | Data |
---|---|---|
8d9254fc | 1 | /* Copyright (C) 2012-2020 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 DZ |
55 | "sha3", sm3/sm4, "sve", "sve2", "sve2-aes", "sve2-sha3", "sve2-sm4", |
56 | "sve2-bitperm", "i8mm" and "bf16". */ | |
3644cadf TC |
57 | AARCH64_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 DZ |
62 | AARCH64_FL_SVE2_BITPERM | AARCH64_FL_I8MM | \ |
63 | AARCH64_FL_BF16, false, "fp") | |
04a99ebe JG |
64 | |
65 | /* Enabling "simd" also enables "fp". | |
43cacb12 | 66 | Disabling "simd" also disables "crypto", "dotprod", "aes", "sha2", "sha3", |
a93e1d5c DZ |
67 | "sm3/sm4", "sve", "sve2", "sve2-aes", "sve2-sha3", "sve2-sm4", |
68 | "sve2-bitperm", and "i8mm". */ | |
3644cadf TC |
69 | AARCH64_OPT_EXTENSION("simd", AARCH64_FL_SIMD, AARCH64_FL_FP, \ |
70 | AARCH64_FL_CRYPTO | AARCH64_FL_DOTPROD | \ | |
71 | AARCH64_FL_AES | AARCH64_FL_SHA2 | AARCH64_FL_SHA3 | \ | |
72 | AARCH64_FL_SM4 | AARCH64_FL_SVE | AARCH64_FL_SVE2 | \ | |
73 | AARCH64_FL_SVE2_AES | AARCH64_FL_SVE2_SHA3 | \ | |
a93e1d5c DZ |
74 | AARCH64_FL_SVE2_SM4 | AARCH64_FL_SVE2_BITPERM | \ |
75 | AARCH64_FL_I8MM, false, \ | |
3644cadf | 76 | "asimd") |
04a99ebe | 77 | |
4ca82fc9 | 78 | /* Enabling "crypto" also enables "fp", "simd", "aes" and "sha2". |
28108a53 MM |
79 | Disabling "crypto" disables "crypto", "aes", "sha2", "sha3" and "sm3/sm4", |
80 | "sve2-aes", "sve2-sha3", "sve2-sm4". */ | |
3644cadf TC |
81 | AARCH64_OPT_EXTENSION("crypto", AARCH64_FL_CRYPTO, AARCH64_FL_FP | \ |
82 | AARCH64_FL_SIMD | AARCH64_FL_AES | AARCH64_FL_SHA2, \ | |
83 | AARCH64_FL_AES | AARCH64_FL_SHA2 | AARCH64_FL_SHA3 | \ | |
84 | AARCH64_FL_SM4 | AARCH64_FL_SVE2_AES | \ | |
85 | AARCH64_FL_SVE2_SHA3 | AARCH64_FL_SVE2_SM4, true, \ | |
86 | "aes pmull sha1 sha2") | |
04a99ebe JG |
87 | |
88 | /* Enabling or disabling "crc" only changes "crc". */ | |
4ca82fc9 | 89 | AARCH64_OPT_EXTENSION("crc", AARCH64_FL_CRC, 0, 0, false, "crc32") |
04a99ebe JG |
90 | |
91 | /* Enabling or disabling "lse" only changes "lse". */ | |
4ca82fc9 | 92 | AARCH64_OPT_EXTENSION("lse", AARCH64_FL_LSE, 0, 0, false, "atomics") |
c61465bd MW |
93 | |
94 | /* Enabling "fp16" also enables "fp". | |
28108a53 | 95 | Disabling "fp16" disables "fp16", "fp16fml", "sve", "sve2", "sve2-aes", |
3644cadf TC |
96 | "sve2-sha3", "sve2-sm4", and "bitperm". */ |
97 | AARCH64_OPT_EXTENSION("fp16", AARCH64_FL_F16, AARCH64_FL_FP, \ | |
98 | AARCH64_FL_F16FML | AARCH64_FL_SVE | AARCH64_FL_SVE2 | \ | |
99 | AARCH64_FL_SVE2_AES | AARCH64_FL_SVE2_SHA3 | \ | |
100 | AARCH64_FL_SVE2_SM4 | AARCH64_FL_SVE2_BITPERM, false, \ | |
101 | "fphp asimdhp") | |
cd8b19af | 102 | |
78295eff | 103 | /* Enabling or disabling "rcpc" only changes "rcpc". */ |
4ca82fc9 | 104 | AARCH64_OPT_EXTENSION("rcpc", AARCH64_FL_RCPC, 0, 0, false, "lrcpc") |
78295eff | 105 | |
43f84f6c JW |
106 | /* Enabling "rdma" also enables "fp", "simd". |
107 | Disabling "rdma" just disables "rdma". */ | |
3644cadf TC |
108 | AARCH64_OPT_EXTENSION("rdma", AARCH64_FL_RDMA, \ |
109 | AARCH64_FL_FP | AARCH64_FL_SIMD, 0, false, "asimdrdm") | |
43f84f6c | 110 | |
1ddc47c0 TC |
111 | /* Enabling "dotprod" also enables "simd". |
112 | Disabling "dotprod" only disables "dotprod". */ | |
3644cadf TC |
113 | AARCH64_OPT_EXTENSION("dotprod", AARCH64_FL_DOTPROD, AARCH64_FL_SIMD, 0, \ |
114 | false, "asimddp") | |
1ddc47c0 | 115 | |
27086ea3 | 116 | /* Enabling "aes" also enables "simd". |
28108a53 | 117 | Disabling "aes" disables "aes" and "sve2-aes'. */ |
3644cadf TC |
118 | AARCH64_OPT_EXTENSION("aes", AARCH64_FL_AES, AARCH64_FL_SIMD, \ |
119 | AARCH64_FL_SVE2_AES, false, "aes") | |
27086ea3 MC |
120 | |
121 | /* Enabling "sha2" also enables "simd". | |
122 | Disabling "sha2" just disables "sha2". */ | |
3644cadf TC |
123 | AARCH64_OPT_EXTENSION("sha2", AARCH64_FL_SHA2, AARCH64_FL_SIMD, 0, false, \ |
124 | "sha1 sha2") | |
27086ea3 MC |
125 | |
126 | /* Enabling "sha3" enables "simd" and "sha2". | |
28108a53 | 127 | Disabling "sha3" disables "sha3" and "sve2-sha3". */ |
3644cadf TC |
128 | AARCH64_OPT_EXTENSION("sha3", AARCH64_FL_SHA3, AARCH64_FL_SIMD | \ |
129 | AARCH64_FL_SHA2, AARCH64_FL_SVE2_SHA3, false, \ | |
130 | "sha3 sha512") | |
27086ea3 MC |
131 | |
132 | /* Enabling "sm4" also enables "simd". | |
28108a53 | 133 | Disabling "sm4" disables "sm4" and "sve2-sm4". */ |
3644cadf TC |
134 | AARCH64_OPT_EXTENSION("sm4", AARCH64_FL_SM4, AARCH64_FL_SIMD, \ |
135 | AARCH64_FL_SVE2_SM4, false, "sm3 sm4") | |
27086ea3 MC |
136 | |
137 | /* Enabling "fp16fml" also enables "fp" and "fp16". | |
138 | Disabling "fp16fml" just disables "fp16fml". */ | |
3644cadf | 139 | AARCH64_OPT_EXTENSION("fp16fml", AARCH64_FL_F16FML, \ |
937960df | 140 | AARCH64_FL_FP | AARCH64_FL_F16, 0, false, "asimdfhm") |
27086ea3 | 141 | |
43cacb12 | 142 | /* Enabling "sve" also enables "fp16", "fp" and "simd". |
28108a53 | 143 | Disabling "sve" disables "sve", "sve2", "sve2-aes", "sve2-sha3", "sve2-sm4" |
c10abf53 | 144 | and "sve2-bitperm". */ |
3644cadf TC |
145 | AARCH64_OPT_EXTENSION("sve", AARCH64_FL_SVE, AARCH64_FL_FP | AARCH64_FL_SIMD | \ |
146 | AARCH64_FL_F16, AARCH64_FL_SVE2 | AARCH64_FL_SVE2_AES | \ | |
147 | AARCH64_FL_SVE2_SHA3 | AARCH64_FL_SVE2_SM4 | \ | |
148 | AARCH64_FL_SVE2_BITPERM, false, "sve") | |
43cacb12 | 149 | |
5170e47e | 150 | /* Enabling/Disabling "profile" does not enable/disable any other feature. */ |
4ca82fc9 | 151 | AARCH64_OPT_EXTENSION("profile", AARCH64_FL_PROFILE, 0, 0, false, "") |
5170e47e | 152 | |
9b4247de | 153 | /* Enabling/Disabling "rng" only changes "rng". */ |
4ca82fc9 | 154 | AARCH64_OPT_EXTENSION("rng", AARCH64_FL_RNG, 0, 0, false, "") |
9b4247de SD |
155 | |
156 | /* Enabling/Disabling "memtag" only changes "memtag". */ | |
4ca82fc9 | 157 | AARCH64_OPT_EXTENSION("memtag", AARCH64_FL_MEMTAG, 0, 0, false, "") |
9b4247de SD |
158 | |
159 | /* Enabling/Disabling "sb" only changes "sb". */ | |
75f93536 | 160 | AARCH64_OPT_EXTENSION("sb", AARCH64_FL_SB, 0, 0, false, "sb") |
9b4247de SD |
161 | |
162 | /* Enabling/Disabling "ssbs" only changes "ssbs". */ | |
75f93536 | 163 | AARCH64_OPT_EXTENSION("ssbs", AARCH64_FL_SSBS, 0, 0, false, "ssbs") |
9b4247de SD |
164 | |
165 | /* Enabling/Disabling "predres" only changes "predres". */ | |
4ca82fc9 | 166 | AARCH64_OPT_EXTENSION("predres", AARCH64_FL_PREDRES, 0, 0, false, "") |
9b4247de | 167 | |
28108a53 MM |
168 | /* Enabling "sve2" also enables "sve", "fp16", "fp", and "simd". |
169 | Disabling "sve2" disables "sve2", "sve2-aes", "sve2-sha3", "sve2-sm4", and | |
c10abf53 | 170 | "sve2-bitperm". */ |
3644cadf TC |
171 | AARCH64_OPT_EXTENSION("sve2", AARCH64_FL_SVE2, AARCH64_FL_SVE | \ |
172 | AARCH64_FL_FP | AARCH64_FL_SIMD | AARCH64_FL_F16, \ | |
173 | AARCH64_FL_SVE2_AES | AARCH64_FL_SVE2_SHA3 | \ | |
75f93536 | 174 | AARCH64_FL_SVE2_SM4 | AARCH64_FL_SVE2_BITPERM, false, "sve2") |
28108a53 MM |
175 | |
176 | /* Enabling "sve2-sm4" also enables "sm4", "simd", "fp16", "fp", "sve", and | |
177 | "sve2". Disabling "sve2-sm4" just disables "sve2-sm4". */ | |
3644cadf TC |
178 | AARCH64_OPT_EXTENSION("sve2-sm4", AARCH64_FL_SVE2_SM4, AARCH64_FL_SM4 | \ |
179 | AARCH64_FL_SIMD | AARCH64_FL_F16 | AARCH64_FL_FP | \ | |
75f93536 | 180 | AARCH64_FL_SVE | AARCH64_FL_SVE2, 0, false, "svesm4") |
28108a53 MM |
181 | |
182 | /* Enabling "sve2-aes" also enables "aes", "simd", "fp16", "fp", "sve", and | |
183 | "sve2". Disabling "sve2-aes" just disables "sve2-aes". */ | |
3644cadf TC |
184 | AARCH64_OPT_EXTENSION("sve2-aes", AARCH64_FL_SVE2_AES, AARCH64_FL_AES | \ |
185 | AARCH64_FL_SIMD | AARCH64_FL_F16 | AARCH64_FL_FP | \ | |
75f93536 | 186 | AARCH64_FL_SVE | AARCH64_FL_SVE2, 0, false, "sveaes") |
28108a53 MM |
187 | |
188 | /* Enabling "sve2-sha3" also enables "sha3", "simd", "fp16", "fp", "sve", and | |
189 | "sve2". Disabling "sve2-sha3" just disables "sve2-sha3". */ | |
3644cadf TC |
190 | AARCH64_OPT_EXTENSION("sve2-sha3", AARCH64_FL_SVE2_SHA3, AARCH64_FL_SHA3 | \ |
191 | AARCH64_FL_SIMD | AARCH64_FL_F16 | AARCH64_FL_FP | \ | |
75f93536 | 192 | AARCH64_FL_SVE | AARCH64_FL_SVE2, 0, false, "svesha3") |
28108a53 | 193 | |
c10abf53 RS |
194 | /* Enabling "sve2-bitperm" also enables "simd", "fp16", "fp", "sve", and |
195 | "sve2". Disabling "sve2-bitperm" just disables "sve2-bitperm". */ | |
3644cadf TC |
196 | AARCH64_OPT_EXTENSION("sve2-bitperm", AARCH64_FL_SVE2_BITPERM, AARCH64_FL_SIMD | \ |
197 | AARCH64_FL_F16 | AARCH64_FL_FP | AARCH64_FL_SVE | \ | |
75f93536 | 198 | AARCH64_FL_SVE2, 0, false, "svebitperm") |
28108a53 | 199 | |
89626179 SD |
200 | /* Enabling or disabling "tme" only changes "tme". */ |
201 | AARCH64_OPT_EXTENSION("tme", AARCH64_FL_TME, 0, 0, false, "") | |
202 | ||
a93e1d5c DZ |
203 | /* Enabling "i8mm" also enables "simd" and "fp". |
204 | Disabling "i8mm" only disables "i8mm". */ | |
205 | AARCH64_OPT_EXTENSION("i8mm", AARCH64_FL_I8MM, \ | |
206 | AARCH64_FL_SIMD | AARCH64_FL_FP, 0, false, "i8mm") | |
207 | ||
208 | /* Enabling "bf16" also enables "simd" and "fp". | |
209 | Disabling "bf16" only disables "bf16". */ | |
210 | AARCH64_OPT_EXTENSION("bf16", AARCH64_FL_BF16, \ | |
211 | AARCH64_FL_SIMD | AARCH64_FL_FP, 0, false, "bf16") | |
212 | ||
cd8b19af | 213 | #undef AARCH64_OPT_EXTENSION |