Merge "Add support for cortex-a55/cortex-a75."

This commit is contained in:
Christopher Ferris 2018-05-11 17:56:12 +00:00 committed by Gerrit Code Review
commit 9623892890
3 changed files with 79 additions and 2 deletions

View File

@ -956,6 +956,7 @@ func getMegaDeviceConfig() []archConfig {
{"arm", "armv7-a-neon", "cortex-a53", []string{"armeabi-v7a"}},
{"arm", "armv7-a-neon", "cortex-a53.a57", []string{"armeabi-v7a"}},
{"arm", "armv7-a-neon", "cortex-a73", []string{"armeabi-v7a"}},
{"arm", "armv7-a-neon", "cortex-a75", []string{"armeabi-v7a"}},
{"arm", "armv7-a-neon", "denver", []string{"armeabi-v7a"}},
{"arm", "armv7-a-neon", "krait", []string{"armeabi-v7a"}},
{"arm", "armv7-a-neon", "kryo", []string{"armeabi-v7a"}},
@ -967,6 +968,7 @@ 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"}},
{"mips", "mips32-fp", "", []string{"mips"}},
{"mips", "mips32r2-fp", "", []string{"mips"}},
{"mips", "mips32r2-fp-xburst", "", []string{"mips"}},

View File

@ -27,6 +27,15 @@ var (
"-Werror=implicit-function-declaration",
}
arm64ArchVariantCflags = map[string][]string{
"armv8-a": []string{
"-march=armv8-a",
},
"armv8-2a": []string{
"-march=armv8.2a",
},
}
arm64Ldflags = []string{
"-Wl,-m,aarch64_elf64_le_vec",
"-Wl,--hash-style=gnu",
@ -44,6 +53,17 @@ var (
"cortex-a53": []string{
"-mcpu=cortex-a53",
},
"cortex-a55": []string{
// The cortex-a55 target is not yet supported,
// so use cortex-a53.
"-mcpu=cortex-a53",
},
"cortex-a75": []string{
// Use the cortex-a53 since it is similar to the little
// core (cortex-a55) and is sensitive to ordering.
// The cortex-a55 target is not yet supported.
"-mcpu=cortex-a53",
},
"kryo": []string{
// Use the cortex-a57 cpu since some compilers
// don't support a Kryo specific target yet.
@ -67,8 +87,11 @@ const (
func init() {
android.RegisterArchVariants(android.Arm64,
"armv8_a",
"armv8_2a",
"cortex-a53",
"cortex-a55",
"cortex-a73",
"cortex-a75",
"kryo",
"exynos-m1",
"exynos-m2",
@ -93,11 +116,19 @@ func init() {
pctx.StaticVariable("Arm64ClangLldflags", strings.Join(ClangFilterUnknownCflags(arm64Lldflags), " "))
pctx.StaticVariable("Arm64ClangCppflags", strings.Join(ClangFilterUnknownCflags(arm64Cppflags), " "))
pctx.StaticVariable("Arm64ClangArmv8ACflags", strings.Join(arm64ArchVariantCflags["armv8-a"], " "))
pctx.StaticVariable("Arm64ClangArmv82ACflags", strings.Join(arm64ArchVariantCflags["armv8-2a"], " "))
pctx.StaticVariable("Arm64CortexA53Cflags",
strings.Join(arm64CpuVariantCflags["cortex-a53"], " "))
pctx.StaticVariable("Arm64ClangCortexA53Cflags",
strings.Join(arm64ClangCpuVariantCflags["cortex-a53"], " "))
pctx.StaticVariable("Arm64CortexA55Cflags",
strings.Join(arm64CpuVariantCflags["cortex-a55"], " "))
pctx.StaticVariable("Arm64ClangCortexA55Cflags",
strings.Join(arm64ClangCpuVariantCflags["cortex-a55"], " "))
pctx.StaticVariable("Arm64KryoCflags",
strings.Join(arm64CpuVariantCflags["kryo"], " "))
pctx.StaticVariable("Arm64ClangKryoCflags",
@ -118,16 +149,25 @@ var (
arm64CpuVariantCflagsVar = map[string]string{
"": "",
"cortex-a53": "${config.Arm64CortexA53Cflags}",
"cortex-a55": "${config.Arm64CortexA55Cflags}",
"cortex-a73": "${config.Arm64CortexA53Cflags}",
"cortex-a75": "${config.Arm64CortexA55Cflags}",
"kryo": "${config.Arm64KryoCflags}",
"exynos-m1": "${config.Arm64ExynosM1Cflags}",
"exynos-m2": "${config.Arm64ExynosM2Cflags}",
}
arm64ClangArchVariantCflagsVar = map[string]string{
"armv8-a": "${config.Arm64ClangArmv8ACflags}",
"armv8-2a": "${config.Arm64ClangArmv82ACflags}",
}
arm64ClangCpuVariantCflagsVar = map[string]string{
"": "",
"cortex-a53": "${config.Arm64ClangCortexA53Cflags}",
"cortex-a55": "${config.Arm64ClangCortexA55Cflags}",
"cortex-a73": "${config.Arm64ClangCortexA53Cflags}",
"cortex-a75": "${config.Arm64ClangCortexA55Cflags}",
"kryo": "${config.Arm64ClangKryoCflags}",
"exynos-m1": "${config.Arm64ClangExynosM1Cflags}",
"exynos-m2": "${config.Arm64ClangExynosM2Cflags}",
@ -206,13 +246,21 @@ func (toolchainArm64) SanitizerRuntimeLibraryArch() string {
}
func arm64ToolchainFactory(arch android.Arch) Toolchain {
if arch.ArchVariant != "armv8-a" {
switch arch.ArchVariant {
case "armv8-a":
case "armv8-2a":
// Nothing extra for armv8-a/armv8-2a
default:
panic(fmt.Sprintf("Unknown ARM architecture version: %q", arch.ArchVariant))
}
toolchainClangCflags := []string{arm64ClangArchVariantCflagsVar[arch.ArchVariant]}
toolchainClangCflags = append(toolchainClangCflags,
variantOrDefault(arm64ClangCpuVariantCflagsVar, arch.CpuVariant))
return &toolchainArm64{
toolchainCflags: variantOrDefault(arm64CpuVariantCflagsVar, arch.CpuVariant),
toolchainClangCflags: variantOrDefault(arm64ClangCpuVariantCflagsVar, arch.CpuVariant),
toolchainClangCflags: strings.Join(toolchainClangCflags, " "),
}
}

View File

@ -99,6 +99,24 @@ var (
// better solution comes around. See Bug 27340895
"-D__ARM_FEATURE_LPAE=1",
},
"cortex-a55": []string{
"-mcpu=cortex-a53",
"-mfpu=neon-fp-armv8",
// Fake an ARM compiler flag as these processors support LPAE which GCC/clang
// don't advertise.
// TODO This is a hack and we need to add it for each processor that supports LPAE until some
// better solution comes around. See Bug 27340895
"-D__ARM_FEATURE_LPAE=1",
},
"cortex-a75": []string{
"-mcpu=cortex-a53",
"-mfpu=neon-fp-armv8",
// Fake an ARM compiler flag as these processors support LPAE which GCC/clang
// don't advertise.
// TODO This is a hack and we need to add it for each processor that supports LPAE until some
// better solution comes around. See Bug 27340895
"-D__ARM_FEATURE_LPAE=1",
},
"krait": []string{
"-mcpu=cortex-a15",
"-mfpu=neon-vfpv4",
@ -143,7 +161,9 @@ func init() {
"cortex-a15",
"cortex-a53",
"cortex-a53-a57",
"cortex-a55",
"cortex-a73",
"cortex-a75",
"krait",
"kryo",
"exynos-m1",
@ -192,6 +212,7 @@ func init() {
pctx.StaticVariable("ArmCortexA8Cflags", strings.Join(armCpuVariantCflags["cortex-a8"], " "))
pctx.StaticVariable("ArmCortexA15Cflags", strings.Join(armCpuVariantCflags["cortex-a15"], " "))
pctx.StaticVariable("ArmCortexA53Cflags", strings.Join(armCpuVariantCflags["cortex-a53"], " "))
pctx.StaticVariable("ArmCortexA55Cflags", strings.Join(armCpuVariantCflags["cortex-a55"], " "))
pctx.StaticVariable("ArmKraitCflags", strings.Join(armCpuVariantCflags["krait"], " "))
pctx.StaticVariable("ArmKryoCflags", strings.Join(armCpuVariantCflags["kryo"], " "))
@ -225,6 +246,8 @@ func init() {
strings.Join(armClangCpuVariantCflags["cortex-a15"], " "))
pctx.StaticVariable("ArmClangCortexA53Cflags",
strings.Join(armClangCpuVariantCflags["cortex-a53"], " "))
pctx.StaticVariable("ArmClangCortexA55Cflags",
strings.Join(armClangCpuVariantCflags["cortex-a55"], " "))
pctx.StaticVariable("ArmClangKraitCflags",
strings.Join(armClangCpuVariantCflags["krait"], " "))
pctx.StaticVariable("ArmClangKryoCflags",
@ -245,7 +268,9 @@ var (
"cortex-a15": "${config.ArmCortexA15Cflags}",
"cortex-a53": "${config.ArmCortexA53Cflags}",
"cortex-a53.a57": "${config.ArmCortexA53Cflags}",
"cortex-a55": "${config.ArmCortexA55Cflags}",
"cortex-a73": "${config.ArmCortexA53Cflags}",
"cortex-a75": "${config.ArmCortexA55Cflags}",
"krait": "${config.ArmKraitCflags}",
"kryo": "${config.ArmKryoCflags}",
"exynos-m1": "${config.ArmCortexA53Cflags}",
@ -266,7 +291,9 @@ var (
"cortex-a15": "${config.ArmClangCortexA15Cflags}",
"cortex-a53": "${config.ArmClangCortexA53Cflags}",
"cortex-a53.a57": "${config.ArmClangCortexA53Cflags}",
"cortex-a55": "${config.ArmClangCortexA55Cflags}",
"cortex-a73": "${config.ArmClangCortexA53Cflags}",
"cortex-a75": "${config.ArmClangCortexA55Cflags}",
"krait": "${config.ArmClangKraitCflags}",
"kryo": "${config.ArmClangKryoCflags}",
"exynos-m1": "${config.ArmClangCortexA53Cflags}",