diff options
author | Dan Willemsen <dwillemsen@google.com> | 2016-06-23 23:44:54 -0700 |
---|---|---|
committer | Dan Willemsen <dwillemsen@google.com> | 2016-09-08 13:50:36 -0700 |
commit | b1957a502116195a534f45c37f15efa35298e520 (patch) | |
tree | 1f3ca32b4b6bf6fe0097f8740d2b201d0c4632cb /cc | |
parent | 42d1ba2d92a965772d92b3b466dcbddf583cb2f3 (diff) | |
download | build_soong-b1957a502116195a534f45c37f15efa35298e520.tar.gz build_soong-b1957a502116195a534f45c37f15efa35298e520.tar.bz2 build_soong-b1957a502116195a534f45c37f15efa35298e520.zip |
Dynamically generate arch struct
Now we don't need to hardcode the list of OS/Arch/Variant/Features in
android/arch.go.
Change-Id: I0f9cc35d55baa31f036825fdf5b9dd30d076e56e
Diffstat (limited to 'cc')
-rw-r--r-- | cc/config/arm64_device.go | 5 | ||||
-rw-r--r-- | cc/config/arm_device.go | 13 | ||||
-rw-r--r-- | cc/config/mips64_device.go | 6 | ||||
-rw-r--r-- | cc/config/mips_device.go | 10 | ||||
-rw-r--r-- | cc/config/x86_64_device.go | 23 | ||||
-rw-r--r-- | cc/config/x86_device.go | 28 |
6 files changed, 72 insertions, 13 deletions
diff --git a/cc/config/arm64_device.go b/cc/config/arm64_device.go index 124b1246..fe47ddfc 100644 --- a/cc/config/arm64_device.go +++ b/cc/config/arm64_device.go @@ -89,6 +89,11 @@ const ( ) func init() { + android.RegisterArchVariants(android.Arm64, + "armv8_a", + "cortex_a53", + "denver64") + pctx.StaticVariable("arm64GccVersion", arm64GccVersion) pctx.SourcePathVariable("Arm64GccRoot", diff --git a/cc/config/arm_device.go b/cc/config/arm_device.go index 85a891a4..1b60eae7 100644 --- a/cc/config/arm_device.go +++ b/cc/config/arm_device.go @@ -145,6 +145,19 @@ const ( ) func init() { + android.RegisterArchVariants(android.Arm, + "armv5te", + "armv7_a", + "armv7_a_neon", + "cortex_a7", + "cortex_a8", + "cortex_a9", + "cortex_a15", + "cortex_a53", + "cortex_a53_a57", + "krait", + "denver") + replaceFirst := func(slice []string, from, to string) { if slice[0] != from { panic(fmt.Errorf("Expected %q, found %q", from, to)) diff --git a/cc/config/mips64_device.go b/cc/config/mips64_device.go index 4e8bf1e7..89978939 100644 --- a/cc/config/mips64_device.go +++ b/cc/config/mips64_device.go @@ -90,7 +90,11 @@ const ( ) func init() { - android.RegisterArchFeatures(android.Mips64, "mips64r6", + android.RegisterArchVariants(android.Mips64, + "mips64r2", + "mips64r6") + android.RegisterArchFeatures(android.Mips64, "rev6") + android.RegisterArchVariantFeatures(android.Mips64, "mips64r6", "rev6") pctx.StaticVariable("mips64GccVersion", mips64GccVersion) diff --git a/cc/config/mips_device.go b/cc/config/mips_device.go index deef10f5..f5b14bd5 100644 --- a/cc/config/mips_device.go +++ b/cc/config/mips_device.go @@ -126,7 +126,15 @@ const ( ) func init() { - android.RegisterArchFeatures(android.Mips, "mips32r6", + android.RegisterArchVariants(android.Mips, + "mips32_fp", + "mips32r2_fp", + "mips32r2_fp_xburst", + "mips32r2dsp_fp", + "mips32r2dspr2_fp", + "mips32r6") + android.RegisterArchFeatures(android.Mips, "rev6") + android.RegisterArchVariantFeatures(android.Mips, "mips32r6", "rev6") pctx.StaticVariable("mipsGccVersion", mipsGccVersion) diff --git a/cc/config/x86_64_device.go b/cc/config/x86_64_device.go index 23c976ac..918ddf74 100644 --- a/cc/config/x86_64_device.go +++ b/cc/config/x86_64_device.go @@ -99,13 +99,26 @@ const ( ) func init() { - android.RegisterArchFeatures(android.X86_64, "", + android.RegisterArchVariants(android.X86_64, + "haswell", + "ivybridge", + "sandybridge", + "silvermont") + android.RegisterArchFeatures(android.X86_64, + "ssse3", + "sse4", + "sse4_1", + "sse4_2", + "aes_ni", + "avx", + "popcnt") + android.RegisterArchVariantFeatures(android.X86_64, "", "ssse3", "sse4", "sse4_1", "sse4_2", "popcnt") - android.RegisterArchFeatures(android.X86_64, "haswell", + android.RegisterArchVariantFeatures(android.X86_64, "haswell", "ssse3", "sse4", "sse4_1", @@ -113,7 +126,7 @@ func init() { "aes_ni", "avx", "popcnt") - android.RegisterArchFeatures(android.X86_64, "ivybridge", + android.RegisterArchVariantFeatures(android.X86_64, "ivybridge", "ssse3", "sse4", "sse4_1", @@ -121,13 +134,13 @@ func init() { "aes_ni", "avx", "popcnt") - android.RegisterArchFeatures(android.X86_64, "sandybridge", + android.RegisterArchVariantFeatures(android.X86_64, "sandybridge", "ssse3", "sse4", "sse4_1", "sse4_2", "popcnt") - android.RegisterArchFeatures(android.X86_64, "silvermont", + android.RegisterArchVariantFeatures(android.X86_64, "silvermont", "ssse3", "sse4", "sse4_1", diff --git a/cc/config/x86_device.go b/cc/config/x86_device.go index 4667caa9..6b555642 100644 --- a/cc/config/x86_device.go +++ b/cc/config/x86_device.go @@ -113,16 +113,32 @@ const ( ) func init() { - android.RegisterArchFeatures(android.X86, "x86_64", + android.RegisterArchVariants(android.X86, + "atom", + "haswell", + "ivybridge", + "sandybridge", + "silvermont", + "x86_64") + android.RegisterArchFeatures(android.X86, + "ssse3", + "sse4", + "sse4_1", + "sse4_2", + "aes_ni", + "avx", + "popcnt", + "movbe") + android.RegisterArchVariantFeatures(android.X86, "x86_64", "ssse3", "sse4", "sse4_1", "sse4_2", "popcnt") - android.RegisterArchFeatures(android.X86, "atom", + android.RegisterArchVariantFeatures(android.X86, "atom", "ssse3", "movbe") - android.RegisterArchFeatures(android.X86, "haswell", + android.RegisterArchVariantFeatures(android.X86, "haswell", "ssse3", "sse4", "sse4_1", @@ -131,7 +147,7 @@ func init() { "avx", "popcnt", "movbe") - android.RegisterArchFeatures(android.X86, "ivybridge", + android.RegisterArchVariantFeatures(android.X86, "ivybridge", "ssse3", "sse4", "sse4_1", @@ -139,13 +155,13 @@ func init() { "aes_ni", "avx", "popcnt") - android.RegisterArchFeatures(android.X86, "sandybridge", + android.RegisterArchVariantFeatures(android.X86, "sandybridge", "ssse3", "sse4", "sse4_1", "sse4_2", "popcnt") - android.RegisterArchFeatures(android.X86, "silvermont", + android.RegisterArchVariantFeatures(android.X86, "silvermont", "ssse3", "sse4", "sse4_1", |