blob: cbf8e7a02f987b6da0c808af69e35501b4e63fad [file] [log] [blame]
Colin Crossa6845402020-11-16 15:08:19 -08001// Copyright 2020 Google Inc. All rights reserved.
2//
3// Licensed under the Apache License, Version 2.0 (the "License");
4// you may not use this file except in compliance with the License.
5// You may obtain a copy of the License at
6//
7// http://www.apache.org/licenses/LICENSE-2.0
8//
9// Unless required by applicable law or agreed to in writing, software
10// distributed under the License is distributed on an "AS IS" BASIS,
11// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12// See the License for the specific language governing permissions and
13// limitations under the License.
14
15package android
16
Colin Crossa6845402020-11-16 15:08:19 -080017var archVariants = map[ArchType][]string{
18 Arm: {
19 "armv7-a",
20 "armv7-a-neon",
21 "armv8-a",
22 "armv8-2a",
Colin Crossa6845402020-11-16 15:08:19 -080023 },
24 Arm64: {
Liz Kammer2c2afe22022-02-11 11:35:03 -050025 "armv8-a",
26 "armv8-a-branchprot",
27 "armv8-2a",
Colin Crossa6845402020-11-16 15:08:19 -080028 "armv8-2a-dotprod",
Colin Crossa6845402020-11-16 15:08:19 -080029 },
30 X86: {
31 "amberlake",
32 "atom",
33 "broadwell",
34 "haswell",
35 "icelake",
36 "ivybridge",
37 "kabylake",
38 "sandybridge",
39 "silvermont",
40 "skylake",
41 "stoneyridge",
42 "tigerlake",
43 "whiskeylake",
44 "x86_64",
45 },
46 X86_64: {
47 "amberlake",
48 "broadwell",
49 "haswell",
50 "icelake",
51 "ivybridge",
52 "kabylake",
53 "sandybridge",
54 "silvermont",
55 "skylake",
56 "stoneyridge",
57 "tigerlake",
58 "whiskeylake",
59 },
60}
61
Liz Kammer2c2afe22022-02-11 11:35:03 -050062var cpuVariants = map[ArchType][]string{
63 Arm: {
64 "cortex-a7",
65 "cortex-a8",
66 "cortex-a9",
67 "cortex-a15",
68 "cortex-a53",
69 "cortex-a53.a57",
70 "cortex-a55",
71 "cortex-a72",
72 "cortex-a73",
73 "cortex-a75",
74 "cortex-a76",
75 "krait",
76 "kryo",
77 "kryo385",
78 "exynos-m1",
79 "exynos-m2",
80 },
81 Arm64: {
82 "cortex-a53",
83 "cortex-a55",
84 "cortex-a72",
85 "cortex-a73",
86 "cortex-a75",
87 "cortex-a76",
88 "kryo",
89 "kryo385",
90 "exynos-m1",
91 "exynos-m2",
92 },
93 X86: {},
94 X86_64: {},
95}
96
Colin Crossa6845402020-11-16 15:08:19 -080097var archFeatures = map[ArchType][]string{
98 Arm: {
99 "neon",
100 },
101 Arm64: {
102 "dotprod",
103 },
104 X86: {
105 "ssse3",
106 "sse4",
107 "sse4_1",
108 "sse4_2",
109 "aes_ni",
110 "avx",
111 "avx2",
112 "avx512",
113 "popcnt",
114 "movbe",
115 },
116 X86_64: {
117 "ssse3",
118 "sse4",
119 "sse4_1",
120 "sse4_2",
121 "aes_ni",
122 "avx",
123 "avx2",
124 "avx512",
125 "popcnt",
126 },
127}
128
Liz Kammere8303bd2022-02-16 09:02:48 -0500129var androidArchFeatureMap = map[ArchType]map[string][]string{
Colin Crossa6845402020-11-16 15:08:19 -0800130 Arm: {
131 "armv7-a-neon": {
132 "neon",
133 },
134 "armv8-a": {
135 "neon",
136 },
137 "armv8-2a": {
138 "neon",
139 },
140 },
141 Arm64: {
142 "armv8-2a-dotprod": {
143 "dotprod",
144 },
145 },
146 X86: {
147 "amberlake": {
148 "ssse3",
149 "sse4",
150 "sse4_1",
151 "sse4_2",
152 "avx",
153 "avx2",
154 "aes_ni",
155 "popcnt",
156 },
157 "atom": {
158 "ssse3",
159 "movbe",
160 },
161 "broadwell": {
162 "ssse3",
163 "sse4",
164 "sse4_1",
165 "sse4_2",
166 "avx",
167 "avx2",
168 "aes_ni",
169 "popcnt",
170 },
171 "haswell": {
172 "ssse3",
173 "sse4",
174 "sse4_1",
175 "sse4_2",
176 "aes_ni",
177 "avx",
178 "popcnt",
179 "movbe",
180 },
181 "icelake": {
182 "ssse3",
183 "sse4",
184 "sse4_1",
185 "sse4_2",
186 "avx",
187 "avx2",
188 "avx512",
189 "aes_ni",
190 "popcnt",
191 },
192 "ivybridge": {
193 "ssse3",
194 "sse4",
195 "sse4_1",
196 "sse4_2",
197 "aes_ni",
198 "avx",
199 "popcnt",
200 },
201 "kabylake": {
202 "ssse3",
203 "sse4",
204 "sse4_1",
205 "sse4_2",
206 "avx",
207 "avx2",
208 "aes_ni",
209 "popcnt",
210 },
211 "sandybridge": {
212 "ssse3",
213 "sse4",
214 "sse4_1",
215 "sse4_2",
216 "popcnt",
217 },
218 "silvermont": {
219 "ssse3",
220 "sse4",
221 "sse4_1",
222 "sse4_2",
223 "aes_ni",
224 "popcnt",
225 "movbe",
226 },
227 "skylake": {
228 "ssse3",
229 "sse4",
230 "sse4_1",
231 "sse4_2",
232 "avx",
233 "avx2",
234 "avx512",
235 "aes_ni",
236 "popcnt",
237 },
238 "stoneyridge": {
239 "ssse3",
240 "sse4",
241 "sse4_1",
242 "sse4_2",
243 "aes_ni",
244 "avx",
245 "avx2",
246 "popcnt",
247 "movbe",
248 },
249 "tigerlake": {
250 "ssse3",
251 "sse4",
252 "sse4_1",
253 "sse4_2",
254 "avx",
255 "avx2",
256 "avx512",
257 "aes_ni",
258 "popcnt",
259 },
260 "whiskeylake": {
261 "ssse3",
262 "sse4",
263 "sse4_1",
264 "sse4_2",
265 "avx",
266 "avx2",
267 "avx512",
268 "aes_ni",
269 "popcnt",
270 },
271 "x86_64": {
272 "ssse3",
273 "sse4",
274 "sse4_1",
275 "sse4_2",
276 "popcnt",
277 },
278 },
279 X86_64: {
Liz Kammere8303bd2022-02-16 09:02:48 -0500280 "" /*default */ : {
281 "ssse3",
282 "sse4",
283 "sse4_1",
284 "sse4_2",
285 "popcnt",
286 },
Colin Crossa6845402020-11-16 15:08:19 -0800287 "amberlake": {
288 "ssse3",
289 "sse4",
290 "sse4_1",
291 "sse4_2",
292 "avx",
293 "avx2",
294 "aes_ni",
295 "popcnt",
296 },
297 "broadwell": {
298 "ssse3",
299 "sse4",
300 "sse4_1",
301 "sse4_2",
302 "avx",
303 "avx2",
304 "aes_ni",
305 "popcnt",
306 },
307 "haswell": {
308 "ssse3",
309 "sse4",
310 "sse4_1",
311 "sse4_2",
312 "aes_ni",
313 "avx",
314 "popcnt",
315 },
316 "icelake": {
317 "ssse3",
318 "sse4",
319 "sse4_1",
320 "sse4_2",
321 "avx",
322 "avx2",
323 "avx512",
324 "aes_ni",
325 "popcnt",
326 },
327 "ivybridge": {
328 "ssse3",
329 "sse4",
330 "sse4_1",
331 "sse4_2",
332 "aes_ni",
333 "avx",
334 "popcnt",
335 },
336 "kabylake": {
337 "ssse3",
338 "sse4",
339 "sse4_1",
340 "sse4_2",
341 "avx",
342 "avx2",
343 "aes_ni",
344 "popcnt",
345 },
346 "sandybridge": {
347 "ssse3",
348 "sse4",
349 "sse4_1",
350 "sse4_2",
351 "popcnt",
352 },
353 "silvermont": {
354 "ssse3",
355 "sse4",
356 "sse4_1",
357 "sse4_2",
358 "aes_ni",
359 "popcnt",
360 },
361 "skylake": {
362 "ssse3",
363 "sse4",
364 "sse4_1",
365 "sse4_2",
366 "avx",
367 "avx2",
368 "avx512",
369 "aes_ni",
370 "popcnt",
371 },
372 "stoneyridge": {
373 "ssse3",
374 "sse4",
375 "sse4_1",
376 "sse4_2",
377 "aes_ni",
378 "avx",
379 "avx2",
380 "popcnt",
381 },
382 "tigerlake": {
383 "ssse3",
384 "sse4",
385 "sse4_1",
386 "sse4_2",
387 "avx",
388 "avx2",
389 "avx512",
390 "aes_ni",
391 "popcnt",
392 },
393 "whiskeylake": {
394 "ssse3",
395 "sse4",
396 "sse4_1",
397 "sse4_2",
398 "avx",
399 "avx2",
400 "avx512",
401 "aes_ni",
402 "popcnt",
403 },
404 },
405}