From 0906f17f7e8bf0e76cb8511669e8fc8d5f6f3794 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 26 Apr 2017 14:00:43 -0700 Subject: [PATCH] Add arm neon and mips dspr2 arch features Current modules must use armv7_a_neon to specify source files that compile only with neon. If a future arch variant also supports neon, all these modules will fall back to non-neon. Support a neon arch feature that modules can use instead. Similarly, support dspr2 for mips. arm_device.go was also mixing armv7-a-neon with armv7_a_neon. Use armv7-a-neon consistently, and fix the - to _ when creating the property structs. Test: m -j checkbuild Change-Id: I24d3764280ab3bcbb9a73c0934edc9b99fc7f6a0 --- android/arch.go | 2 ++ cc/config/arm_device.go | 21 +++++++++++++-------- cc/config/mips_device.go | 6 +++++- 3 files changed, 20 insertions(+), 9 deletions(-) diff --git a/android/arch.go b/android/arch.go index 2d0515ffa..e777475f7 100644 --- a/android/arch.go +++ b/android/arch.go @@ -417,9 +417,11 @@ func createArchType(props reflect.Type) reflect.Type { variants := []string{} for _, archVariant := range archVariants[arch] { + archVariant := variantReplacer.Replace(archVariant) variants = append(variants, proptools.FieldNameForProperty(archVariant)) } for _, feature := range archFeatures[arch] { + feature := variantReplacer.Replace(feature) variants = append(variants, proptools.FieldNameForProperty(feature)) } diff --git a/cc/config/arm_device.go b/cc/config/arm_device.go index 5d17d15c1..94627e7dc 100644 --- a/cc/config/arm_device.go +++ b/cc/config/arm_device.go @@ -156,20 +156,25 @@ const ( ) func init() { + android.RegisterArchFeatures(android.Arm, + "neon") + android.RegisterArchVariants(android.Arm, "armv5te", - "armv7_a", - "armv7_a_neon", - "cortex_a7", - "cortex_a8", - "cortex_a9", - "cortex_a15", - "cortex_a53", - "cortex_a53_a57", + "armv7-a", + "armv7-a-neon", + "cortex-a7", + "cortex-a8", + "cortex-a9", + "cortex-a15", + "cortex-a53", + "cortex-a53-a57", "krait", "kryo", "denver") + android.RegisterArchVariantFeatures(android.Arm, "armv7-a-neon", "neon") + // Krait and Kryo targets are not supported by GCC, but are supported by Clang, // so override the definitions when building modules with Clang. replaceFirst(armClangCpuVariantCflags["krait"], "-mcpu=cortex-a15", "-mcpu=krait") diff --git a/cc/config/mips_device.go b/cc/config/mips_device.go index ccd60d618..42025a2fa 100644 --- a/cc/config/mips_device.go +++ b/cc/config/mips_device.go @@ -133,7 +133,11 @@ func init() { "mips32r2dsp_fp", "mips32r2dspr2_fp", "mips32r6") - android.RegisterArchFeatures(android.Mips, "rev6") + android.RegisterArchFeatures(android.Mips, + "dspr2", + "rev6") + android.RegisterArchVariantFeatures(android.Mips, "mips32r2dspr2_fp", + "dspr2") android.RegisterArchVariantFeatures(android.Mips, "mips32r6", "rev6")