blob: 07777c1bdd3d276b2db5629e2af470333b5ad763 [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",
Evgenii Stepanov80d74922023-02-10 19:13:49 -080029 "armv9-a",
Colin Crossa6845402020-11-16 15:08:19 -080030 },
31 X86: {
32 "amberlake",
33 "atom",
34 "broadwell",
Ryo Hashimotof68c18f2022-11-16 17:25:01 +090035 "goldmont",
36 "goldmont-plus",
Colin Crossa6845402020-11-16 15:08:19 -080037 "haswell",
38 "icelake",
39 "ivybridge",
40 "kabylake",
41 "sandybridge",
42 "silvermont",
43 "skylake",
44 "stoneyridge",
45 "tigerlake",
Ryo Hashimotof68c18f2022-11-16 17:25:01 +090046 "tremont",
Colin Crossa6845402020-11-16 15:08:19 -080047 "whiskeylake",
48 "x86_64",
49 },
50 X86_64: {
51 "amberlake",
52 "broadwell",
Ryo Hashimotof68c18f2022-11-16 17:25:01 +090053 "goldmont",
54 "goldmont-plus",
Colin Crossa6845402020-11-16 15:08:19 -080055 "haswell",
56 "icelake",
57 "ivybridge",
58 "kabylake",
59 "sandybridge",
60 "silvermont",
61 "skylake",
62 "stoneyridge",
63 "tigerlake",
Ryo Hashimotof68c18f2022-11-16 17:25:01 +090064 "tremont",
Colin Crossa6845402020-11-16 15:08:19 -080065 "whiskeylake",
66 },
67}
68
Liz Kammer2c2afe22022-02-11 11:35:03 -050069var cpuVariants = map[ArchType][]string{
70 Arm: {
71 "cortex-a7",
72 "cortex-a8",
73 "cortex-a9",
74 "cortex-a15",
75 "cortex-a53",
76 "cortex-a53.a57",
77 "cortex-a55",
78 "cortex-a72",
79 "cortex-a73",
80 "cortex-a75",
81 "cortex-a76",
82 "krait",
83 "kryo",
84 "kryo385",
85 "exynos-m1",
86 "exynos-m2",
87 },
88 Arm64: {
89 "cortex-a53",
90 "cortex-a55",
91 "cortex-a72",
92 "cortex-a73",
93 "cortex-a75",
94 "cortex-a76",
95 "kryo",
96 "kryo385",
97 "exynos-m1",
98 "exynos-m2",
99 },
100 X86: {},
101 X86_64: {},
102}
103
Colin Crossa6845402020-11-16 15:08:19 -0800104var archFeatures = map[ArchType][]string{
105 Arm: {
106 "neon",
107 },
108 Arm64: {
109 "dotprod",
110 },
111 X86: {
112 "ssse3",
113 "sse4",
114 "sse4_1",
115 "sse4_2",
116 "aes_ni",
117 "avx",
118 "avx2",
119 "avx512",
120 "popcnt",
121 "movbe",
122 },
123 X86_64: {
124 "ssse3",
125 "sse4",
126 "sse4_1",
127 "sse4_2",
128 "aes_ni",
129 "avx",
130 "avx2",
131 "avx512",
132 "popcnt",
133 },
134}
135
Liz Kammere8303bd2022-02-16 09:02:48 -0500136var androidArchFeatureMap = map[ArchType]map[string][]string{
Colin Crossa6845402020-11-16 15:08:19 -0800137 Arm: {
138 "armv7-a-neon": {
139 "neon",
140 },
141 "armv8-a": {
142 "neon",
143 },
144 "armv8-2a": {
145 "neon",
146 },
147 },
148 Arm64: {
149 "armv8-2a-dotprod": {
150 "dotprod",
151 },
Evgenii Stepanov80d74922023-02-10 19:13:49 -0800152 "armv9-a": {
153 "dotprod",
154 },
Colin Crossa6845402020-11-16 15:08:19 -0800155 },
156 X86: {
157 "amberlake": {
158 "ssse3",
159 "sse4",
160 "sse4_1",
161 "sse4_2",
162 "avx",
163 "avx2",
164 "aes_ni",
165 "popcnt",
166 },
167 "atom": {
168 "ssse3",
169 "movbe",
170 },
171 "broadwell": {
172 "ssse3",
173 "sse4",
174 "sse4_1",
175 "sse4_2",
176 "avx",
177 "avx2",
178 "aes_ni",
179 "popcnt",
180 },
Ryo Hashimotof68c18f2022-11-16 17:25:01 +0900181 "goldmont": {
182 "ssse3",
183 "sse4",
184 "sse4_1",
185 "sse4_2",
186 "aes_ni",
187 "popcnt",
188 "movbe",
189 },
190 "goldmont-plus": {
191 "ssse3",
192 "sse4",
193 "sse4_1",
194 "sse4_2",
195 "aes_ni",
196 "popcnt",
197 "movbe",
198 },
Colin Crossa6845402020-11-16 15:08:19 -0800199 "haswell": {
200 "ssse3",
201 "sse4",
202 "sse4_1",
203 "sse4_2",
204 "aes_ni",
205 "avx",
206 "popcnt",
207 "movbe",
208 },
209 "icelake": {
210 "ssse3",
211 "sse4",
212 "sse4_1",
213 "sse4_2",
214 "avx",
215 "avx2",
216 "avx512",
217 "aes_ni",
218 "popcnt",
219 },
220 "ivybridge": {
221 "ssse3",
222 "sse4",
223 "sse4_1",
224 "sse4_2",
225 "aes_ni",
226 "avx",
227 "popcnt",
228 },
229 "kabylake": {
230 "ssse3",
231 "sse4",
232 "sse4_1",
233 "sse4_2",
234 "avx",
235 "avx2",
236 "aes_ni",
237 "popcnt",
238 },
239 "sandybridge": {
240 "ssse3",
241 "sse4",
242 "sse4_1",
243 "sse4_2",
244 "popcnt",
245 },
246 "silvermont": {
247 "ssse3",
248 "sse4",
249 "sse4_1",
250 "sse4_2",
251 "aes_ni",
252 "popcnt",
253 "movbe",
254 },
255 "skylake": {
256 "ssse3",
257 "sse4",
258 "sse4_1",
259 "sse4_2",
260 "avx",
261 "avx2",
262 "avx512",
263 "aes_ni",
264 "popcnt",
265 },
266 "stoneyridge": {
267 "ssse3",
268 "sse4",
269 "sse4_1",
270 "sse4_2",
271 "aes_ni",
272 "avx",
273 "avx2",
274 "popcnt",
275 "movbe",
276 },
277 "tigerlake": {
278 "ssse3",
279 "sse4",
280 "sse4_1",
281 "sse4_2",
282 "avx",
283 "avx2",
284 "avx512",
285 "aes_ni",
286 "popcnt",
287 },
Ryo Hashimotof68c18f2022-11-16 17:25:01 +0900288 "tremont": {
289 "ssse3",
290 "sse4",
291 "sse4_1",
292 "sse4_2",
293 "aes_ni",
294 "popcnt",
295 "movbe",
296 },
Colin Crossa6845402020-11-16 15:08:19 -0800297 "whiskeylake": {
298 "ssse3",
299 "sse4",
300 "sse4_1",
301 "sse4_2",
302 "avx",
303 "avx2",
304 "avx512",
305 "aes_ni",
306 "popcnt",
307 },
308 "x86_64": {
309 "ssse3",
310 "sse4",
311 "sse4_1",
312 "sse4_2",
313 "popcnt",
314 },
315 },
316 X86_64: {
Liz Kammere8303bd2022-02-16 09:02:48 -0500317 "" /*default */ : {
318 "ssse3",
319 "sse4",
320 "sse4_1",
321 "sse4_2",
322 "popcnt",
323 },
Colin Crossa6845402020-11-16 15:08:19 -0800324 "amberlake": {
325 "ssse3",
326 "sse4",
327 "sse4_1",
328 "sse4_2",
329 "avx",
330 "avx2",
331 "aes_ni",
332 "popcnt",
333 },
334 "broadwell": {
335 "ssse3",
336 "sse4",
337 "sse4_1",
338 "sse4_2",
339 "avx",
340 "avx2",
341 "aes_ni",
342 "popcnt",
343 },
Ryo Hashimotof68c18f2022-11-16 17:25:01 +0900344 "goldmont": {
345 "ssse3",
346 "sse4",
347 "sse4_1",
348 "sse4_2",
349 "aes_ni",
350 "popcnt",
351 },
352 "goldmont-plus": {
353 "ssse3",
354 "sse4",
355 "sse4_1",
356 "sse4_2",
357 "aes_ni",
358 "popcnt",
359 },
Colin Crossa6845402020-11-16 15:08:19 -0800360 "haswell": {
361 "ssse3",
362 "sse4",
363 "sse4_1",
364 "sse4_2",
365 "aes_ni",
366 "avx",
367 "popcnt",
368 },
369 "icelake": {
370 "ssse3",
371 "sse4",
372 "sse4_1",
373 "sse4_2",
374 "avx",
375 "avx2",
376 "avx512",
377 "aes_ni",
378 "popcnt",
379 },
380 "ivybridge": {
381 "ssse3",
382 "sse4",
383 "sse4_1",
384 "sse4_2",
385 "aes_ni",
386 "avx",
387 "popcnt",
388 },
389 "kabylake": {
390 "ssse3",
391 "sse4",
392 "sse4_1",
393 "sse4_2",
394 "avx",
395 "avx2",
396 "aes_ni",
397 "popcnt",
398 },
399 "sandybridge": {
400 "ssse3",
401 "sse4",
402 "sse4_1",
403 "sse4_2",
404 "popcnt",
405 },
406 "silvermont": {
407 "ssse3",
408 "sse4",
409 "sse4_1",
410 "sse4_2",
411 "aes_ni",
412 "popcnt",
413 },
414 "skylake": {
415 "ssse3",
416 "sse4",
417 "sse4_1",
418 "sse4_2",
419 "avx",
420 "avx2",
421 "avx512",
422 "aes_ni",
423 "popcnt",
424 },
425 "stoneyridge": {
426 "ssse3",
427 "sse4",
428 "sse4_1",
429 "sse4_2",
430 "aes_ni",
431 "avx",
432 "avx2",
433 "popcnt",
434 },
435 "tigerlake": {
436 "ssse3",
437 "sse4",
438 "sse4_1",
439 "sse4_2",
440 "avx",
441 "avx2",
442 "avx512",
443 "aes_ni",
444 "popcnt",
445 },
Ryo Hashimotof68c18f2022-11-16 17:25:01 +0900446 "tremont": {
447 "ssse3",
448 "sse4",
449 "sse4_1",
450 "sse4_2",
451 "aes_ni",
452 "popcnt",
453 },
Colin Crossa6845402020-11-16 15:08:19 -0800454 "whiskeylake": {
455 "ssse3",
456 "sse4",
457 "sse4_1",
458 "sse4_2",
459 "avx",
460 "avx2",
461 "avx512",
462 "aes_ni",
463 "popcnt",
464 },
465 },
466}