blob: ab644a4aa947bc54c97db110f79394bd1e15f60d [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",
Jesus Sanchez-Palenciade7c7842023-03-02 16:56:05 -080075 "cortex-a32",
Liz Kammer2c2afe22022-02-11 11:35:03 -050076 "cortex-a53",
77 "cortex-a53.a57",
78 "cortex-a55",
79 "cortex-a72",
80 "cortex-a73",
81 "cortex-a75",
82 "cortex-a76",
83 "krait",
84 "kryo",
85 "kryo385",
86 "exynos-m1",
87 "exynos-m2",
88 },
89 Arm64: {
90 "cortex-a53",
91 "cortex-a55",
92 "cortex-a72",
93 "cortex-a73",
94 "cortex-a75",
95 "cortex-a76",
96 "kryo",
97 "kryo385",
98 "exynos-m1",
99 "exynos-m2",
100 },
101 X86: {},
102 X86_64: {},
103}
104
Colin Crossa6845402020-11-16 15:08:19 -0800105var archFeatures = map[ArchType][]string{
106 Arm: {
107 "neon",
108 },
109 Arm64: {
110 "dotprod",
111 },
112 X86: {
113 "ssse3",
114 "sse4",
115 "sse4_1",
116 "sse4_2",
117 "aes_ni",
118 "avx",
119 "avx2",
120 "avx512",
121 "popcnt",
122 "movbe",
123 },
124 X86_64: {
125 "ssse3",
126 "sse4",
127 "sse4_1",
128 "sse4_2",
129 "aes_ni",
130 "avx",
131 "avx2",
132 "avx512",
133 "popcnt",
134 },
135}
136
Liz Kammere8303bd2022-02-16 09:02:48 -0500137var androidArchFeatureMap = map[ArchType]map[string][]string{
Colin Crossa6845402020-11-16 15:08:19 -0800138 Arm: {
139 "armv7-a-neon": {
140 "neon",
141 },
142 "armv8-a": {
143 "neon",
144 },
145 "armv8-2a": {
146 "neon",
147 },
148 },
149 Arm64: {
150 "armv8-2a-dotprod": {
151 "dotprod",
152 },
Evgenii Stepanov80d74922023-02-10 19:13:49 -0800153 "armv9-a": {
154 "dotprod",
155 },
Colin Crossa6845402020-11-16 15:08:19 -0800156 },
157 X86: {
158 "amberlake": {
159 "ssse3",
160 "sse4",
161 "sse4_1",
162 "sse4_2",
163 "avx",
164 "avx2",
165 "aes_ni",
166 "popcnt",
167 },
168 "atom": {
169 "ssse3",
170 "movbe",
171 },
172 "broadwell": {
173 "ssse3",
174 "sse4",
175 "sse4_1",
176 "sse4_2",
177 "avx",
178 "avx2",
179 "aes_ni",
180 "popcnt",
181 },
Ryo Hashimotof68c18f2022-11-16 17:25:01 +0900182 "goldmont": {
183 "ssse3",
184 "sse4",
185 "sse4_1",
186 "sse4_2",
187 "aes_ni",
188 "popcnt",
189 "movbe",
190 },
191 "goldmont-plus": {
192 "ssse3",
193 "sse4",
194 "sse4_1",
195 "sse4_2",
196 "aes_ni",
197 "popcnt",
198 "movbe",
199 },
Colin Crossa6845402020-11-16 15:08:19 -0800200 "haswell": {
201 "ssse3",
202 "sse4",
203 "sse4_1",
204 "sse4_2",
205 "aes_ni",
206 "avx",
207 "popcnt",
208 "movbe",
209 },
210 "icelake": {
211 "ssse3",
212 "sse4",
213 "sse4_1",
214 "sse4_2",
215 "avx",
216 "avx2",
217 "avx512",
218 "aes_ni",
219 "popcnt",
220 },
221 "ivybridge": {
222 "ssse3",
223 "sse4",
224 "sse4_1",
225 "sse4_2",
226 "aes_ni",
227 "avx",
228 "popcnt",
229 },
230 "kabylake": {
231 "ssse3",
232 "sse4",
233 "sse4_1",
234 "sse4_2",
235 "avx",
236 "avx2",
237 "aes_ni",
238 "popcnt",
239 },
240 "sandybridge": {
241 "ssse3",
242 "sse4",
243 "sse4_1",
244 "sse4_2",
245 "popcnt",
246 },
247 "silvermont": {
248 "ssse3",
249 "sse4",
250 "sse4_1",
251 "sse4_2",
252 "aes_ni",
253 "popcnt",
254 "movbe",
255 },
256 "skylake": {
257 "ssse3",
258 "sse4",
259 "sse4_1",
260 "sse4_2",
261 "avx",
262 "avx2",
263 "avx512",
264 "aes_ni",
265 "popcnt",
266 },
267 "stoneyridge": {
268 "ssse3",
269 "sse4",
270 "sse4_1",
271 "sse4_2",
272 "aes_ni",
273 "avx",
274 "avx2",
275 "popcnt",
276 "movbe",
277 },
278 "tigerlake": {
279 "ssse3",
280 "sse4",
281 "sse4_1",
282 "sse4_2",
283 "avx",
284 "avx2",
285 "avx512",
286 "aes_ni",
287 "popcnt",
288 },
Ryo Hashimotof68c18f2022-11-16 17:25:01 +0900289 "tremont": {
290 "ssse3",
291 "sse4",
292 "sse4_1",
293 "sse4_2",
294 "aes_ni",
295 "popcnt",
296 "movbe",
297 },
Colin Crossa6845402020-11-16 15:08:19 -0800298 "whiskeylake": {
299 "ssse3",
300 "sse4",
301 "sse4_1",
302 "sse4_2",
303 "avx",
304 "avx2",
305 "avx512",
306 "aes_ni",
307 "popcnt",
308 },
309 "x86_64": {
310 "ssse3",
311 "sse4",
312 "sse4_1",
313 "sse4_2",
314 "popcnt",
315 },
316 },
317 X86_64: {
Liz Kammere8303bd2022-02-16 09:02:48 -0500318 "" /*default */ : {
319 "ssse3",
320 "sse4",
321 "sse4_1",
322 "sse4_2",
323 "popcnt",
324 },
Colin Crossa6845402020-11-16 15:08:19 -0800325 "amberlake": {
326 "ssse3",
327 "sse4",
328 "sse4_1",
329 "sse4_2",
330 "avx",
331 "avx2",
332 "aes_ni",
333 "popcnt",
334 },
335 "broadwell": {
336 "ssse3",
337 "sse4",
338 "sse4_1",
339 "sse4_2",
340 "avx",
341 "avx2",
342 "aes_ni",
343 "popcnt",
344 },
Ryo Hashimotof68c18f2022-11-16 17:25:01 +0900345 "goldmont": {
346 "ssse3",
347 "sse4",
348 "sse4_1",
349 "sse4_2",
350 "aes_ni",
351 "popcnt",
352 },
353 "goldmont-plus": {
354 "ssse3",
355 "sse4",
356 "sse4_1",
357 "sse4_2",
358 "aes_ni",
359 "popcnt",
360 },
Colin Crossa6845402020-11-16 15:08:19 -0800361 "haswell": {
362 "ssse3",
363 "sse4",
364 "sse4_1",
365 "sse4_2",
366 "aes_ni",
367 "avx",
368 "popcnt",
369 },
370 "icelake": {
371 "ssse3",
372 "sse4",
373 "sse4_1",
374 "sse4_2",
375 "avx",
376 "avx2",
377 "avx512",
378 "aes_ni",
379 "popcnt",
380 },
381 "ivybridge": {
382 "ssse3",
383 "sse4",
384 "sse4_1",
385 "sse4_2",
386 "aes_ni",
387 "avx",
388 "popcnt",
389 },
390 "kabylake": {
391 "ssse3",
392 "sse4",
393 "sse4_1",
394 "sse4_2",
395 "avx",
396 "avx2",
397 "aes_ni",
398 "popcnt",
399 },
400 "sandybridge": {
401 "ssse3",
402 "sse4",
403 "sse4_1",
404 "sse4_2",
405 "popcnt",
406 },
407 "silvermont": {
408 "ssse3",
409 "sse4",
410 "sse4_1",
411 "sse4_2",
412 "aes_ni",
413 "popcnt",
414 },
415 "skylake": {
416 "ssse3",
417 "sse4",
418 "sse4_1",
419 "sse4_2",
420 "avx",
421 "avx2",
422 "avx512",
423 "aes_ni",
424 "popcnt",
425 },
426 "stoneyridge": {
427 "ssse3",
428 "sse4",
429 "sse4_1",
430 "sse4_2",
431 "aes_ni",
432 "avx",
433 "avx2",
434 "popcnt",
435 },
436 "tigerlake": {
437 "ssse3",
438 "sse4",
439 "sse4_1",
440 "sse4_2",
441 "avx",
442 "avx2",
443 "avx512",
444 "aes_ni",
445 "popcnt",
446 },
Ryo Hashimotof68c18f2022-11-16 17:25:01 +0900447 "tremont": {
448 "ssse3",
449 "sse4",
450 "sse4_1",
451 "sse4_2",
452 "aes_ni",
453 "popcnt",
454 },
Colin Crossa6845402020-11-16 15:08:19 -0800455 "whiskeylake": {
456 "ssse3",
457 "sse4",
458 "sse4_1",
459 "sse4_2",
460 "avx",
461 "avx2",
462 "avx512",
463 "aes_ni",
464 "popcnt",
465 },
466 },
467}