[ARM] Add support for Cortex-M7, FPv5-SP and FPv5-DP
The Cortex-M7 has 3 options for its FPU: none, FPv5-SP-D16 and
FPv5-DP-D16. FPv5 has the same instructions as FP-ARMv8, so it can be
modeled using the same target feature, and all double-precision
operations are already disabled by the fp-only-sp target features.
llvm-svn: 218748
diff --git a/clang/lib/Driver/Tools.cpp b/clang/lib/Driver/Tools.cpp
index 50c101f..99e34e4 100644
--- a/clang/lib/Driver/Tools.cpp
+++ b/clang/lib/Driver/Tools.cpp
@@ -544,6 +544,18 @@
Features.push_back("+d16");
Features.push_back("+fp-only-sp");
Features.push_back("-neon");
+ } else if (FPU == "fp5-sp-d16" || FPU == "fpv5-sp-d16") {
+ Features.push_back("+fp-armv8");
+ Features.push_back("+fp-only-sp");
+ Features.push_back("+d16");
+ Features.push_back("-neon");
+ Features.push_back("-crypto");
+ } else if (FPU == "fp5-dp-d16" || FPU == "fpv5-dp-d16" ||
+ FPU == "fp5-d16" || FPU == "fpv5-d16") {
+ Features.push_back("+fp-armv8");
+ Features.push_back("+d16");
+ Features.push_back("-neon");
+ Features.push_back("-crypto");
} else if (FPU == "fp-armv8") {
Features.push_back("+fp-armv8");
Features.push_back("-neon");
@@ -5340,7 +5352,7 @@
.Cases("cortex-r4", "cortex-r5", "v7r")
.Case("cortex-m0", "v6m")
.Case("cortex-m3", "v7m")
- .Case("cortex-m4", "v7em")
+ .Cases("cortex-m4", "cortex-m7", "v7em")
.Case("swift", "v7s")
.Case("cyclone", "v8")
.Cases("cortex-a53", "cortex-a57", "v8")