blob: 801ac49c8079c88dec6f04c4b8022881ee782dd0 [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",
Satoshi Niwac41f2112023-12-14 17:33:36 +090037 // Target arch is goldmont, but without xsaves support.
38 // This ensures efficient execution on a broad range of Intel/AMD CPUs used
39 // in Chromebooks, including those lacking xsaves support.
40 // (e.g. Kaby Lake, Gemini Lake, Alder Lake and AMD Zen series)
41 "goldmont-without-xsaves",
Colin Crossa6845402020-11-16 15:08:19 -080042 "haswell",
43 "icelake",
44 "ivybridge",
45 "kabylake",
46 "sandybridge",
47 "silvermont",
48 "skylake",
49 "stoneyridge",
50 "tigerlake",
Ryo Hashimotof68c18f2022-11-16 17:25:01 +090051 "tremont",
Colin Crossa6845402020-11-16 15:08:19 -080052 "whiskeylake",
53 "x86_64",
54 },
55 X86_64: {
56 "amberlake",
57 "broadwell",
Ryo Hashimotof68c18f2022-11-16 17:25:01 +090058 "goldmont",
59 "goldmont-plus",
Satoshi Niwac41f2112023-12-14 17:33:36 +090060 "goldmont-without-xsaves",
Colin Crossa6845402020-11-16 15:08:19 -080061 "haswell",
62 "icelake",
63 "ivybridge",
64 "kabylake",
65 "sandybridge",
66 "silvermont",
67 "skylake",
68 "stoneyridge",
69 "tigerlake",
Ryo Hashimotof68c18f2022-11-16 17:25:01 +090070 "tremont",
Colin Crossa6845402020-11-16 15:08:19 -080071 "whiskeylake",
72 },
73}
74
Liz Kammer2c2afe22022-02-11 11:35:03 -050075var cpuVariants = map[ArchType][]string{
76 Arm: {
77 "cortex-a7",
78 "cortex-a8",
79 "cortex-a9",
80 "cortex-a15",
Jesus Sanchez-Palenciade7c7842023-03-02 16:56:05 -080081 "cortex-a32",
Liz Kammer2c2afe22022-02-11 11:35:03 -050082 "cortex-a53",
83 "cortex-a53.a57",
84 "cortex-a55",
85 "cortex-a72",
86 "cortex-a73",
87 "cortex-a75",
88 "cortex-a76",
89 "krait",
90 "kryo",
91 "kryo385",
92 "exynos-m1",
93 "exynos-m2",
94 },
95 Arm64: {
96 "cortex-a53",
97 "cortex-a55",
98 "cortex-a72",
99 "cortex-a73",
100 "cortex-a75",
101 "cortex-a76",
102 "kryo",
103 "kryo385",
104 "exynos-m1",
105 "exynos-m2",
106 },
107 X86: {},
108 X86_64: {},
109}
110
Colin Crossa6845402020-11-16 15:08:19 -0800111var archFeatures = map[ArchType][]string{
112 Arm: {
113 "neon",
114 },
115 Arm64: {
116 "dotprod",
117 },
118 X86: {
119 "ssse3",
120 "sse4",
121 "sse4_1",
122 "sse4_2",
123 "aes_ni",
124 "avx",
125 "avx2",
126 "avx512",
127 "popcnt",
128 "movbe",
129 },
130 X86_64: {
131 "ssse3",
132 "sse4",
133 "sse4_1",
134 "sse4_2",
135 "aes_ni",
136 "avx",
137 "avx2",
138 "avx512",
139 "popcnt",
140 },
141}
142
Liz Kammere8303bd2022-02-16 09:02:48 -0500143var androidArchFeatureMap = map[ArchType]map[string][]string{
Colin Crossa6845402020-11-16 15:08:19 -0800144 Arm: {
145 "armv7-a-neon": {
146 "neon",
147 },
148 "armv8-a": {
149 "neon",
150 },
151 "armv8-2a": {
152 "neon",
153 },
154 },
155 Arm64: {
156 "armv8-2a-dotprod": {
157 "dotprod",
158 },
Evgenii Stepanov80d74922023-02-10 19:13:49 -0800159 "armv9-a": {
160 "dotprod",
161 },
Colin Crossa6845402020-11-16 15:08:19 -0800162 },
163 X86: {
164 "amberlake": {
165 "ssse3",
166 "sse4",
167 "sse4_1",
168 "sse4_2",
169 "avx",
170 "avx2",
171 "aes_ni",
172 "popcnt",
173 },
174 "atom": {
175 "ssse3",
176 "movbe",
177 },
178 "broadwell": {
179 "ssse3",
180 "sse4",
181 "sse4_1",
182 "sse4_2",
183 "avx",
184 "avx2",
185 "aes_ni",
186 "popcnt",
187 },
Ryo Hashimotof68c18f2022-11-16 17:25:01 +0900188 "goldmont": {
189 "ssse3",
190 "sse4",
191 "sse4_1",
192 "sse4_2",
193 "aes_ni",
194 "popcnt",
195 "movbe",
196 },
197 "goldmont-plus": {
198 "ssse3",
199 "sse4",
200 "sse4_1",
201 "sse4_2",
202 "aes_ni",
203 "popcnt",
204 "movbe",
205 },
Satoshi Niwac41f2112023-12-14 17:33:36 +0900206 "goldmont-without-xsaves": {
207 "ssse3",
208 "sse4",
209 "sse4_1",
210 "sse4_2",
211 "aes_ni",
212 "popcnt",
213 "movbe",
214 },
Colin Crossa6845402020-11-16 15:08:19 -0800215 "haswell": {
216 "ssse3",
217 "sse4",
218 "sse4_1",
219 "sse4_2",
220 "aes_ni",
221 "avx",
222 "popcnt",
223 "movbe",
224 },
225 "icelake": {
226 "ssse3",
227 "sse4",
228 "sse4_1",
229 "sse4_2",
230 "avx",
231 "avx2",
232 "avx512",
233 "aes_ni",
234 "popcnt",
235 },
236 "ivybridge": {
237 "ssse3",
238 "sse4",
239 "sse4_1",
240 "sse4_2",
241 "aes_ni",
242 "avx",
243 "popcnt",
244 },
245 "kabylake": {
246 "ssse3",
247 "sse4",
248 "sse4_1",
249 "sse4_2",
250 "avx",
251 "avx2",
252 "aes_ni",
253 "popcnt",
254 },
255 "sandybridge": {
256 "ssse3",
257 "sse4",
258 "sse4_1",
259 "sse4_2",
260 "popcnt",
261 },
262 "silvermont": {
263 "ssse3",
264 "sse4",
265 "sse4_1",
266 "sse4_2",
267 "aes_ni",
268 "popcnt",
269 "movbe",
270 },
271 "skylake": {
272 "ssse3",
273 "sse4",
274 "sse4_1",
275 "sse4_2",
276 "avx",
277 "avx2",
278 "avx512",
279 "aes_ni",
280 "popcnt",
281 },
282 "stoneyridge": {
283 "ssse3",
284 "sse4",
285 "sse4_1",
286 "sse4_2",
287 "aes_ni",
288 "avx",
289 "avx2",
290 "popcnt",
291 "movbe",
292 },
293 "tigerlake": {
294 "ssse3",
295 "sse4",
296 "sse4_1",
297 "sse4_2",
298 "avx",
299 "avx2",
300 "avx512",
301 "aes_ni",
302 "popcnt",
303 },
Ryo Hashimotof68c18f2022-11-16 17:25:01 +0900304 "tremont": {
305 "ssse3",
306 "sse4",
307 "sse4_1",
308 "sse4_2",
309 "aes_ni",
310 "popcnt",
311 "movbe",
312 },
Colin Crossa6845402020-11-16 15:08:19 -0800313 "whiskeylake": {
314 "ssse3",
315 "sse4",
316 "sse4_1",
317 "sse4_2",
318 "avx",
319 "avx2",
320 "avx512",
321 "aes_ni",
322 "popcnt",
323 },
324 "x86_64": {
325 "ssse3",
326 "sse4",
327 "sse4_1",
328 "sse4_2",
329 "popcnt",
330 },
331 },
332 X86_64: {
Liz Kammere8303bd2022-02-16 09:02:48 -0500333 "" /*default */ : {
334 "ssse3",
335 "sse4",
336 "sse4_1",
337 "sse4_2",
338 "popcnt",
339 },
Colin Crossa6845402020-11-16 15:08:19 -0800340 "amberlake": {
341 "ssse3",
342 "sse4",
343 "sse4_1",
344 "sse4_2",
345 "avx",
346 "avx2",
347 "aes_ni",
348 "popcnt",
349 },
350 "broadwell": {
351 "ssse3",
352 "sse4",
353 "sse4_1",
354 "sse4_2",
355 "avx",
356 "avx2",
357 "aes_ni",
358 "popcnt",
359 },
Ryo Hashimotof68c18f2022-11-16 17:25:01 +0900360 "goldmont": {
361 "ssse3",
362 "sse4",
363 "sse4_1",
364 "sse4_2",
365 "aes_ni",
366 "popcnt",
367 },
368 "goldmont-plus": {
369 "ssse3",
370 "sse4",
371 "sse4_1",
372 "sse4_2",
373 "aes_ni",
374 "popcnt",
375 },
Satoshi Niwac41f2112023-12-14 17:33:36 +0900376 "goldmont-without-xsaves": {
377 "ssse3",
378 "sse4",
379 "sse4_1",
380 "sse4_2",
381 "aes_ni",
382 "popcnt",
383 },
Colin Crossa6845402020-11-16 15:08:19 -0800384 "haswell": {
385 "ssse3",
386 "sse4",
387 "sse4_1",
388 "sse4_2",
389 "aes_ni",
390 "avx",
391 "popcnt",
392 },
393 "icelake": {
394 "ssse3",
395 "sse4",
396 "sse4_1",
397 "sse4_2",
398 "avx",
399 "avx2",
400 "avx512",
401 "aes_ni",
402 "popcnt",
403 },
404 "ivybridge": {
405 "ssse3",
406 "sse4",
407 "sse4_1",
408 "sse4_2",
409 "aes_ni",
410 "avx",
411 "popcnt",
412 },
413 "kabylake": {
414 "ssse3",
415 "sse4",
416 "sse4_1",
417 "sse4_2",
418 "avx",
419 "avx2",
420 "aes_ni",
421 "popcnt",
422 },
423 "sandybridge": {
424 "ssse3",
425 "sse4",
426 "sse4_1",
427 "sse4_2",
428 "popcnt",
429 },
430 "silvermont": {
431 "ssse3",
432 "sse4",
433 "sse4_1",
434 "sse4_2",
435 "aes_ni",
436 "popcnt",
437 },
438 "skylake": {
439 "ssse3",
440 "sse4",
441 "sse4_1",
442 "sse4_2",
443 "avx",
444 "avx2",
445 "avx512",
446 "aes_ni",
447 "popcnt",
448 },
449 "stoneyridge": {
450 "ssse3",
451 "sse4",
452 "sse4_1",
453 "sse4_2",
454 "aes_ni",
455 "avx",
456 "avx2",
457 "popcnt",
458 },
459 "tigerlake": {
460 "ssse3",
461 "sse4",
462 "sse4_1",
463 "sse4_2",
464 "avx",
465 "avx2",
466 "avx512",
467 "aes_ni",
468 "popcnt",
469 },
Ryo Hashimotof68c18f2022-11-16 17:25:01 +0900470 "tremont": {
471 "ssse3",
472 "sse4",
473 "sse4_1",
474 "sse4_2",
475 "aes_ni",
476 "popcnt",
477 },
Colin Crossa6845402020-11-16 15:08:19 -0800478 "whiskeylake": {
479 "ssse3",
480 "sse4",
481 "sse4_1",
482 "sse4_2",
483 "avx",
484 "avx2",
485 "avx512",
486 "aes_ni",
487 "popcnt",
488 },
489 },
490}