2020-11-17 00:08:19 +01:00
|
|
|
// Copyright 2020 Google Inc. All rights reserved.
|
|
|
|
//
|
|
|
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
|
|
// you may not use this file except in compliance with the License.
|
|
|
|
// You may obtain a copy of the License at
|
|
|
|
//
|
|
|
|
// http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
//
|
|
|
|
// Unless required by applicable law or agreed to in writing, software
|
|
|
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
// See the License for the specific language governing permissions and
|
|
|
|
// limitations under the License.
|
|
|
|
|
|
|
|
package android
|
|
|
|
|
|
|
|
var archVariants = map[ArchType][]string{
|
|
|
|
Arm: {
|
|
|
|
"armv7-a",
|
|
|
|
"armv7-a-neon",
|
|
|
|
"armv8-a",
|
|
|
|
"armv8-2a",
|
|
|
|
},
|
|
|
|
Arm64: {
|
2022-02-11 17:35:03 +01:00
|
|
|
"armv8-a",
|
|
|
|
"armv8-a-branchprot",
|
|
|
|
"armv8-2a",
|
2020-11-17 00:08:19 +01:00
|
|
|
"armv8-2a-dotprod",
|
2023-02-11 04:13:49 +01:00
|
|
|
"armv9-a",
|
2020-11-17 00:08:19 +01:00
|
|
|
},
|
|
|
|
X86: {
|
|
|
|
"amberlake",
|
|
|
|
"atom",
|
|
|
|
"broadwell",
|
2022-11-16 09:25:01 +01:00
|
|
|
"goldmont",
|
|
|
|
"goldmont-plus",
|
2024-01-24 08:17:00 +01:00
|
|
|
// Target arch is goldmont, but without supporting SHA and XSAVES.
|
2023-12-14 09:33:36 +01:00
|
|
|
// This ensures efficient execution on a broad range of Intel/AMD CPUs used
|
2024-01-24 08:17:00 +01:00
|
|
|
// in Chromebooks, including those lacking SHA or XSAVES support.
|
2023-12-14 09:33:36 +01:00
|
|
|
// (e.g. Kaby Lake, Gemini Lake, Alder Lake and AMD Zen series)
|
2024-01-24 08:17:00 +01:00
|
|
|
"goldmont-without-sha-xsaves",
|
2020-11-17 00:08:19 +01:00
|
|
|
"haswell",
|
|
|
|
"icelake",
|
|
|
|
"ivybridge",
|
|
|
|
"kabylake",
|
|
|
|
"sandybridge",
|
|
|
|
"silvermont",
|
|
|
|
"skylake",
|
|
|
|
"stoneyridge",
|
|
|
|
"tigerlake",
|
2022-11-16 09:25:01 +01:00
|
|
|
"tremont",
|
2020-11-17 00:08:19 +01:00
|
|
|
"whiskeylake",
|
|
|
|
"x86_64",
|
|
|
|
},
|
|
|
|
X86_64: {
|
|
|
|
"amberlake",
|
|
|
|
"broadwell",
|
2022-11-16 09:25:01 +01:00
|
|
|
"goldmont",
|
|
|
|
"goldmont-plus",
|
2024-01-24 08:17:00 +01:00
|
|
|
"goldmont-without-sha-xsaves",
|
2020-11-17 00:08:19 +01:00
|
|
|
"haswell",
|
|
|
|
"icelake",
|
|
|
|
"ivybridge",
|
|
|
|
"kabylake",
|
|
|
|
"sandybridge",
|
|
|
|
"silvermont",
|
|
|
|
"skylake",
|
|
|
|
"stoneyridge",
|
|
|
|
"tigerlake",
|
2022-11-16 09:25:01 +01:00
|
|
|
"tremont",
|
2020-11-17 00:08:19 +01:00
|
|
|
"whiskeylake",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2022-02-11 17:35:03 +01:00
|
|
|
var cpuVariants = map[ArchType][]string{
|
|
|
|
Arm: {
|
|
|
|
"cortex-a7",
|
|
|
|
"cortex-a8",
|
|
|
|
"cortex-a9",
|
|
|
|
"cortex-a15",
|
2023-03-03 01:56:05 +01:00
|
|
|
"cortex-a32",
|
2022-02-11 17:35:03 +01:00
|
|
|
"cortex-a53",
|
|
|
|
"cortex-a53.a57",
|
|
|
|
"cortex-a55",
|
|
|
|
"cortex-a72",
|
|
|
|
"cortex-a73",
|
|
|
|
"cortex-a75",
|
|
|
|
"cortex-a76",
|
|
|
|
"krait",
|
|
|
|
"kryo",
|
|
|
|
"kryo385",
|
|
|
|
"exynos-m1",
|
|
|
|
"exynos-m2",
|
|
|
|
},
|
|
|
|
Arm64: {
|
|
|
|
"cortex-a53",
|
|
|
|
"cortex-a55",
|
|
|
|
"cortex-a72",
|
|
|
|
"cortex-a73",
|
|
|
|
"cortex-a75",
|
|
|
|
"cortex-a76",
|
|
|
|
"kryo",
|
|
|
|
"kryo385",
|
|
|
|
"exynos-m1",
|
|
|
|
"exynos-m2",
|
|
|
|
},
|
|
|
|
X86: {},
|
|
|
|
X86_64: {},
|
|
|
|
}
|
|
|
|
|
2020-11-17 00:08:19 +01:00
|
|
|
var archFeatures = map[ArchType][]string{
|
|
|
|
Arm: {
|
|
|
|
"neon",
|
|
|
|
},
|
|
|
|
Arm64: {
|
|
|
|
"dotprod",
|
|
|
|
},
|
|
|
|
X86: {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"avx512",
|
|
|
|
"popcnt",
|
|
|
|
"movbe",
|
|
|
|
},
|
|
|
|
X86_64: {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"avx512",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
}
|
|
|
|
|
2022-02-16 15:02:48 +01:00
|
|
|
var androidArchFeatureMap = map[ArchType]map[string][]string{
|
2020-11-17 00:08:19 +01:00
|
|
|
Arm: {
|
|
|
|
"armv7-a-neon": {
|
|
|
|
"neon",
|
|
|
|
},
|
|
|
|
"armv8-a": {
|
|
|
|
"neon",
|
|
|
|
},
|
|
|
|
"armv8-2a": {
|
|
|
|
"neon",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
Arm64: {
|
|
|
|
"armv8-2a-dotprod": {
|
|
|
|
"dotprod",
|
|
|
|
},
|
2023-02-11 04:13:49 +01:00
|
|
|
"armv9-a": {
|
|
|
|
"dotprod",
|
|
|
|
},
|
2020-11-17 00:08:19 +01:00
|
|
|
},
|
|
|
|
X86: {
|
|
|
|
"amberlake": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"atom": {
|
|
|
|
"ssse3",
|
|
|
|
"movbe",
|
|
|
|
},
|
|
|
|
"broadwell": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
2022-11-16 09:25:01 +01:00
|
|
|
"goldmont": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
"movbe",
|
|
|
|
},
|
|
|
|
"goldmont-plus": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
"movbe",
|
|
|
|
},
|
2024-01-24 08:17:00 +01:00
|
|
|
"goldmont-without-sha-xsaves": {
|
2023-12-14 09:33:36 +01:00
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
"movbe",
|
|
|
|
},
|
2020-11-17 00:08:19 +01:00
|
|
|
"haswell": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"avx",
|
|
|
|
"popcnt",
|
|
|
|
"movbe",
|
|
|
|
},
|
|
|
|
"icelake": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"avx512",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"ivybridge": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"avx",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"kabylake": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"sandybridge": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"silvermont": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
"movbe",
|
|
|
|
},
|
|
|
|
"skylake": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"avx512",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"stoneyridge": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"popcnt",
|
|
|
|
"movbe",
|
|
|
|
},
|
|
|
|
"tigerlake": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"avx512",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
2022-11-16 09:25:01 +01:00
|
|
|
"tremont": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
"movbe",
|
|
|
|
},
|
2020-11-17 00:08:19 +01:00
|
|
|
"whiskeylake": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"avx512",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"x86_64": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
X86_64: {
|
2022-02-16 15:02:48 +01:00
|
|
|
"" /*default */ : {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"popcnt",
|
|
|
|
},
|
2020-11-17 00:08:19 +01:00
|
|
|
"amberlake": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"broadwell": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
2022-11-16 09:25:01 +01:00
|
|
|
"goldmont": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"goldmont-plus": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
2024-01-24 08:17:00 +01:00
|
|
|
"goldmont-without-sha-xsaves": {
|
2023-12-14 09:33:36 +01:00
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
2020-11-17 00:08:19 +01:00
|
|
|
"haswell": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"avx",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"icelake": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"avx512",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"ivybridge": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"avx",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"kabylake": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"sandybridge": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"silvermont": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"skylake": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"avx512",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"stoneyridge": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
"tigerlake": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"avx512",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
2022-11-16 09:25:01 +01:00
|
|
|
"tremont": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
2020-11-17 00:08:19 +01:00
|
|
|
"whiskeylake": {
|
|
|
|
"ssse3",
|
|
|
|
"sse4",
|
|
|
|
"sse4_1",
|
|
|
|
"sse4_2",
|
|
|
|
"avx",
|
|
|
|
"avx2",
|
|
|
|
"avx512",
|
|
|
|
"aes_ni",
|
|
|
|
"popcnt",
|
|
|
|
},
|
|
|
|
},
|
|
|
|
}
|