blob: a47d5ebc08edea15c64323b8af1e9e679aaa94a9 [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: {
Colin Crossa6845402020-11-16 15:08:19 -080019 "armv7-a-neon",
20 "armv8-a",
21 "armv8-2a",
Colin Crossa6845402020-11-16 15:08:19 -080022 },
23 Arm64: {
Liz Kammer2c2afe22022-02-11 11:35:03 -050024 "armv8-a",
25 "armv8-a-branchprot",
26 "armv8-2a",
Colin Crossa6845402020-11-16 15:08:19 -080027 "armv8-2a-dotprod",
Evgenii Stepanov80d74922023-02-10 19:13:49 -080028 "armv9-a",
Krzysztof Kosińskib8c5e952024-09-07 00:01:55 +000029 "armv9-2a",
Colin Crossa6845402020-11-16 15:08:19 -080030 },
31 X86: {
Yudhistira Erlandinata162b4892024-09-23 11:53:16 +080032 "alderlake",
Colin Crossa6845402020-11-16 15:08:19 -080033 "amberlake",
34 "atom",
35 "broadwell",
Ryo Hashimotof68c18f2022-11-16 17:25:01 +090036 "goldmont",
37 "goldmont-plus",
Satoshi Niwab6d818d2024-01-24 16:17:00 +090038 // Target arch is goldmont, but without supporting SHA and XSAVES.
Satoshi Niwac41f2112023-12-14 17:33:36 +090039 // This ensures efficient execution on a broad range of Intel/AMD CPUs used
Satoshi Niwab6d818d2024-01-24 16:17:00 +090040 // in Chromebooks, including those lacking SHA or XSAVES support.
Satoshi Niwac41f2112023-12-14 17:33:36 +090041 // (e.g. Kaby Lake, Gemini Lake, Alder Lake and AMD Zen series)
Satoshi Niwab6d818d2024-01-24 16:17:00 +090042 "goldmont-without-sha-xsaves",
Colin Crossa6845402020-11-16 15:08:19 -080043 "haswell",
44 "icelake",
45 "ivybridge",
46 "kabylake",
47 "sandybridge",
48 "silvermont",
49 "skylake",
50 "stoneyridge",
51 "tigerlake",
Ryo Hashimotof68c18f2022-11-16 17:25:01 +090052 "tremont",
Colin Crossa6845402020-11-16 15:08:19 -080053 "whiskeylake",
54 "x86_64",
55 },
56 X86_64: {
Yudhistira Erlandinata162b4892024-09-23 11:53:16 +080057 "alderlake",
Colin Crossa6845402020-11-16 15:08:19 -080058 "amberlake",
59 "broadwell",
Ryo Hashimotof68c18f2022-11-16 17:25:01 +090060 "goldmont",
61 "goldmont-plus",
Satoshi Niwab6d818d2024-01-24 16:17:00 +090062 "goldmont-without-sha-xsaves",
Colin Crossa6845402020-11-16 15:08:19 -080063 "haswell",
64 "icelake",
65 "ivybridge",
66 "kabylake",
67 "sandybridge",
68 "silvermont",
69 "skylake",
70 "stoneyridge",
71 "tigerlake",
Ryo Hashimotof68c18f2022-11-16 17:25:01 +090072 "tremont",
Colin Crossa6845402020-11-16 15:08:19 -080073 "whiskeylake",
74 },
75}
76
Liz Kammer2c2afe22022-02-11 11:35:03 -050077var cpuVariants = map[ArchType][]string{
78 Arm: {
79 "cortex-a7",
80 "cortex-a8",
81 "cortex-a9",
82 "cortex-a15",
Jesus Sanchez-Palenciade7c7842023-03-02 16:56:05 -080083 "cortex-a32",
Liz Kammer2c2afe22022-02-11 11:35:03 -050084 "cortex-a53",
85 "cortex-a53.a57",
86 "cortex-a55",
87 "cortex-a72",
88 "cortex-a73",
89 "cortex-a75",
90 "cortex-a76",
91 "krait",
92 "kryo",
93 "kryo385",
94 "exynos-m1",
95 "exynos-m2",
96 },
97 Arm64: {
98 "cortex-a53",
99 "cortex-a55",
100 "cortex-a72",
101 "cortex-a73",
102 "cortex-a75",
103 "cortex-a76",
104 "kryo",
105 "kryo385",
106 "exynos-m1",
107 "exynos-m2",
Roopesh Nataraja826912e2024-07-08 15:27:45 -0700108 "oryon",
Liz Kammer2c2afe22022-02-11 11:35:03 -0500109 },
110 X86: {},
111 X86_64: {},
112}
113
Colin Crossa6845402020-11-16 15:08:19 -0800114var archFeatures = map[ArchType][]string{
115 Arm: {
116 "neon",
117 },
118 Arm64: {
119 "dotprod",
120 },
121 X86: {
122 "ssse3",
123 "sse4",
124 "sse4_1",
125 "sse4_2",
126 "aes_ni",
127 "avx",
128 "avx2",
129 "avx512",
130 "popcnt",
131 "movbe",
132 },
133 X86_64: {
134 "ssse3",
135 "sse4",
136 "sse4_1",
137 "sse4_2",
138 "aes_ni",
139 "avx",
140 "avx2",
141 "avx512",
142 "popcnt",
143 },
144}
145
Liz Kammere8303bd2022-02-16 09:02:48 -0500146var androidArchFeatureMap = map[ArchType]map[string][]string{
Colin Crossa6845402020-11-16 15:08:19 -0800147 Arm: {
148 "armv7-a-neon": {
149 "neon",
150 },
151 "armv8-a": {
152 "neon",
153 },
154 "armv8-2a": {
155 "neon",
156 },
157 },
158 Arm64: {
159 "armv8-2a-dotprod": {
160 "dotprod",
161 },
Evgenii Stepanov80d74922023-02-10 19:13:49 -0800162 "armv9-a": {
163 "dotprod",
164 },
Krzysztof Kosiński918d2652024-09-04 21:24:06 +0000165 "armv9-2a": {
166 "dotprod",
167 },
Colin Crossa6845402020-11-16 15:08:19 -0800168 },
169 X86: {
Yudhistira Erlandinata162b4892024-09-23 11:53:16 +0800170 "alderlake": {
171 "ssse3",
172 "sse4",
173 "sse4_1",
174 "sse4_2",
175 "avx",
176 "avx2",
177 "aes_ni",
178 "popcnt",
179 },
Colin Crossa6845402020-11-16 15:08:19 -0800180 "amberlake": {
181 "ssse3",
182 "sse4",
183 "sse4_1",
184 "sse4_2",
185 "avx",
186 "avx2",
187 "aes_ni",
188 "popcnt",
189 },
190 "atom": {
191 "ssse3",
192 "movbe",
193 },
194 "broadwell": {
195 "ssse3",
196 "sse4",
197 "sse4_1",
198 "sse4_2",
199 "avx",
200 "avx2",
201 "aes_ni",
202 "popcnt",
203 },
Ryo Hashimotof68c18f2022-11-16 17:25:01 +0900204 "goldmont": {
205 "ssse3",
206 "sse4",
207 "sse4_1",
208 "sse4_2",
209 "aes_ni",
210 "popcnt",
211 "movbe",
212 },
213 "goldmont-plus": {
214 "ssse3",
215 "sse4",
216 "sse4_1",
217 "sse4_2",
218 "aes_ni",
219 "popcnt",
220 "movbe",
221 },
Satoshi Niwab6d818d2024-01-24 16:17:00 +0900222 "goldmont-without-sha-xsaves": {
Satoshi Niwac41f2112023-12-14 17:33:36 +0900223 "ssse3",
224 "sse4",
225 "sse4_1",
226 "sse4_2",
227 "aes_ni",
228 "popcnt",
229 "movbe",
230 },
Colin Crossa6845402020-11-16 15:08:19 -0800231 "haswell": {
232 "ssse3",
233 "sse4",
234 "sse4_1",
235 "sse4_2",
236 "aes_ni",
237 "avx",
238 "popcnt",
239 "movbe",
240 },
241 "icelake": {
242 "ssse3",
243 "sse4",
244 "sse4_1",
245 "sse4_2",
246 "avx",
247 "avx2",
248 "avx512",
249 "aes_ni",
250 "popcnt",
251 },
252 "ivybridge": {
253 "ssse3",
254 "sse4",
255 "sse4_1",
256 "sse4_2",
257 "aes_ni",
258 "avx",
259 "popcnt",
260 },
261 "kabylake": {
262 "ssse3",
263 "sse4",
264 "sse4_1",
265 "sse4_2",
266 "avx",
267 "avx2",
268 "aes_ni",
269 "popcnt",
270 },
271 "sandybridge": {
272 "ssse3",
273 "sse4",
274 "sse4_1",
275 "sse4_2",
276 "popcnt",
277 },
278 "silvermont": {
279 "ssse3",
280 "sse4",
281 "sse4_1",
282 "sse4_2",
283 "aes_ni",
284 "popcnt",
285 "movbe",
286 },
287 "skylake": {
288 "ssse3",
289 "sse4",
290 "sse4_1",
291 "sse4_2",
292 "avx",
293 "avx2",
294 "avx512",
295 "aes_ni",
296 "popcnt",
297 },
298 "stoneyridge": {
299 "ssse3",
300 "sse4",
301 "sse4_1",
302 "sse4_2",
303 "aes_ni",
304 "avx",
305 "avx2",
306 "popcnt",
307 "movbe",
308 },
309 "tigerlake": {
310 "ssse3",
311 "sse4",
312 "sse4_1",
313 "sse4_2",
314 "avx",
315 "avx2",
316 "avx512",
317 "aes_ni",
318 "popcnt",
319 },
Ryo Hashimotof68c18f2022-11-16 17:25:01 +0900320 "tremont": {
321 "ssse3",
322 "sse4",
323 "sse4_1",
324 "sse4_2",
325 "aes_ni",
326 "popcnt",
327 "movbe",
328 },
Colin Crossa6845402020-11-16 15:08:19 -0800329 "whiskeylake": {
330 "ssse3",
331 "sse4",
332 "sse4_1",
333 "sse4_2",
334 "avx",
335 "avx2",
336 "avx512",
337 "aes_ni",
338 "popcnt",
339 },
340 "x86_64": {
341 "ssse3",
342 "sse4",
343 "sse4_1",
344 "sse4_2",
345 "popcnt",
346 },
347 },
348 X86_64: {
Liz Kammere8303bd2022-02-16 09:02:48 -0500349 "" /*default */ : {
350 "ssse3",
351 "sse4",
352 "sse4_1",
353 "sse4_2",
354 "popcnt",
355 },
Yudhistira Erlandinata162b4892024-09-23 11:53:16 +0800356 "alderlake": {
357 "ssse3",
358 "sse4",
359 "sse4_1",
360 "sse4_2",
361 "avx",
362 "avx2",
363 "aes_ni",
364 "popcnt",
365 },
Colin Crossa6845402020-11-16 15:08:19 -0800366 "amberlake": {
367 "ssse3",
368 "sse4",
369 "sse4_1",
370 "sse4_2",
371 "avx",
372 "avx2",
373 "aes_ni",
374 "popcnt",
375 },
376 "broadwell": {
377 "ssse3",
378 "sse4",
379 "sse4_1",
380 "sse4_2",
381 "avx",
382 "avx2",
383 "aes_ni",
384 "popcnt",
385 },
Ryo Hashimotof68c18f2022-11-16 17:25:01 +0900386 "goldmont": {
387 "ssse3",
388 "sse4",
389 "sse4_1",
390 "sse4_2",
391 "aes_ni",
392 "popcnt",
393 },
394 "goldmont-plus": {
395 "ssse3",
396 "sse4",
397 "sse4_1",
398 "sse4_2",
399 "aes_ni",
400 "popcnt",
401 },
Satoshi Niwab6d818d2024-01-24 16:17:00 +0900402 "goldmont-without-sha-xsaves": {
Satoshi Niwac41f2112023-12-14 17:33:36 +0900403 "ssse3",
404 "sse4",
405 "sse4_1",
406 "sse4_2",
407 "aes_ni",
408 "popcnt",
409 },
Colin Crossa6845402020-11-16 15:08:19 -0800410 "haswell": {
411 "ssse3",
412 "sse4",
413 "sse4_1",
414 "sse4_2",
415 "aes_ni",
416 "avx",
417 "popcnt",
418 },
419 "icelake": {
420 "ssse3",
421 "sse4",
422 "sse4_1",
423 "sse4_2",
424 "avx",
425 "avx2",
426 "avx512",
427 "aes_ni",
428 "popcnt",
429 },
430 "ivybridge": {
431 "ssse3",
432 "sse4",
433 "sse4_1",
434 "sse4_2",
435 "aes_ni",
436 "avx",
437 "popcnt",
438 },
439 "kabylake": {
440 "ssse3",
441 "sse4",
442 "sse4_1",
443 "sse4_2",
444 "avx",
445 "avx2",
446 "aes_ni",
447 "popcnt",
448 },
449 "sandybridge": {
450 "ssse3",
451 "sse4",
452 "sse4_1",
453 "sse4_2",
454 "popcnt",
455 },
456 "silvermont": {
457 "ssse3",
458 "sse4",
459 "sse4_1",
460 "sse4_2",
461 "aes_ni",
462 "popcnt",
463 },
464 "skylake": {
465 "ssse3",
466 "sse4",
467 "sse4_1",
468 "sse4_2",
469 "avx",
470 "avx2",
471 "avx512",
472 "aes_ni",
473 "popcnt",
474 },
475 "stoneyridge": {
476 "ssse3",
477 "sse4",
478 "sse4_1",
479 "sse4_2",
480 "aes_ni",
481 "avx",
482 "avx2",
483 "popcnt",
484 },
485 "tigerlake": {
486 "ssse3",
487 "sse4",
488 "sse4_1",
489 "sse4_2",
490 "avx",
491 "avx2",
492 "avx512",
493 "aes_ni",
494 "popcnt",
495 },
Ryo Hashimotof68c18f2022-11-16 17:25:01 +0900496 "tremont": {
497 "ssse3",
498 "sse4",
499 "sse4_1",
500 "sse4_2",
501 "aes_ni",
502 "popcnt",
503 },
Colin Crossa6845402020-11-16 15:08:19 -0800504 "whiskeylake": {
505 "ssse3",
506 "sse4",
507 "sse4_1",
508 "sse4_2",
509 "avx",
510 "avx2",
511 "avx512",
512 "aes_ni",
513 "popcnt",
514 },
515 },
516}