Introduce new Arm64 arch variant with dot product features
In order to rely on `-march`/`-mcpu` compiler flags for feature detection, we introduce a new arch variant based on armv8.2 with the addition of dot product features. Test: test-art-target on Pixel 4. Change-Id: I4d97db6129e2cd718a2b21008d36ec767739f925
This commit is contained in:
parent
81a0b66d93
commit
70b96b0d64
|
@ -124,6 +124,7 @@ var archVariants = map[ArchType][]string{
|
|||
Arm64: {
|
||||
"armv8_a",
|
||||
"armv8_2a",
|
||||
"armv8-2a-dotprod",
|
||||
"cortex-a53",
|
||||
"cortex-a55",
|
||||
"cortex-a72",
|
||||
|
@ -171,6 +172,9 @@ var archFeatures = map[ArchType][]string{
|
|||
Arm: {
|
||||
"neon",
|
||||
},
|
||||
Arm64: {
|
||||
"dotprod",
|
||||
},
|
||||
X86: {
|
||||
"ssse3",
|
||||
"sse4",
|
||||
|
@ -208,6 +212,11 @@ var archFeatureMap = map[ArchType]map[string][]string{
|
|||
"neon",
|
||||
},
|
||||
},
|
||||
Arm64: {
|
||||
"armv8-2a-dotprod": {
|
||||
"dotprod",
|
||||
},
|
||||
},
|
||||
X86: {
|
||||
"amberlake": {
|
||||
"ssse3",
|
||||
|
@ -1615,9 +1624,10 @@ func getMegaDeviceConfig() []archConfig {
|
|||
{"arm64", "armv8-a", "kryo", []string{"arm64-v8a"}},
|
||||
{"arm64", "armv8-a", "exynos-m1", []string{"arm64-v8a"}},
|
||||
{"arm64", "armv8-a", "exynos-m2", []string{"arm64-v8a"}},
|
||||
{"arm64", "armv8-2a", "cortex-a75", []string{"arm64-v8a"}},
|
||||
{"arm64", "armv8-2a", "cortex-a76", []string{"arm64-v8a"}},
|
||||
{"arm64", "armv8-2a", "kryo385", []string{"arm64-v8a"}},
|
||||
{"arm64", "armv8-2a-dotprod", "cortex-a55", []string{"arm64-v8a"}},
|
||||
{"arm64", "armv8-2a-dotprod", "cortex-a75", []string{"arm64-v8a"}},
|
||||
{"arm64", "armv8-2a-dotprod", "cortex-a76", []string{"arm64-v8a"}},
|
||||
{"x86", "", "", []string{"x86"}},
|
||||
{"x86", "atom", "", []string{"x86"}},
|
||||
{"x86", "haswell", "", []string{"x86"}},
|
||||
|
|
|
@ -34,6 +34,9 @@ var (
|
|||
"armv8-2a": []string{
|
||||
"-march=armv8.2-a",
|
||||
},
|
||||
"armv8-2a-dotprod": []string{
|
||||
"-march=armv8.2-a+dotprod",
|
||||
},
|
||||
}
|
||||
|
||||
arm64Ldflags = []string{
|
||||
|
@ -100,6 +103,7 @@ func init() {
|
|||
|
||||
pctx.StaticVariable("Arm64ClangArmv8ACflags", strings.Join(arm64ArchVariantCflags["armv8-a"], " "))
|
||||
pctx.StaticVariable("Arm64ClangArmv82ACflags", strings.Join(arm64ArchVariantCflags["armv8-2a"], " "))
|
||||
pctx.StaticVariable("Arm64ClangArmv82ADotprodCflags", strings.Join(arm64ArchVariantCflags["armv8-2a-dotprod"], " "))
|
||||
|
||||
pctx.StaticVariable("Arm64ClangCortexA53Cflags",
|
||||
strings.Join(arm64ClangCpuVariantCflags["cortex-a53"], " "))
|
||||
|
@ -121,6 +125,7 @@ var (
|
|||
arm64ClangArchVariantCflagsVar = map[string]string{
|
||||
"armv8-a": "${config.Arm64ClangArmv8ACflags}",
|
||||
"armv8-2a": "${config.Arm64ClangArmv82ACflags}",
|
||||
"armv8-2a-dotprod": "${config.Arm64ClangArmv82ADotprodCflags}",
|
||||
}
|
||||
|
||||
arm64ClangCpuVariantCflagsVar = map[string]string{
|
||||
|
@ -198,6 +203,7 @@ func arm64ToolchainFactory(arch android.Arch) Toolchain {
|
|||
switch arch.ArchVariant {
|
||||
case "armv8-a":
|
||||
case "armv8-2a":
|
||||
case "armv8-2a-dotprod":
|
||||
// Nothing extra for armv8-a/armv8-2a
|
||||
default:
|
||||
panic(fmt.Sprintf("Unknown ARM architecture version: %q", arch.ArchVariant))
|
||||
|
|
|
@ -33,6 +33,7 @@ var (
|
|||
Arm64ArchVariantRustFlags = map[string][]string{
|
||||
"armv8-a": []string{},
|
||||
"armv8-2a": []string{},
|
||||
"armv8-2a-dotprod": []string{},
|
||||
}
|
||||
)
|
||||
|
||||
|
|
Loading…
Reference in New Issue