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