]> granicus.if.org Git - clang/commitdiff
Fix Neon detection for Cortex-A class, plus adds some more CPUs to default features
authorRenato Golin <renato.golin@linaro.org>
Fri, 13 Sep 2013 17:02:45 +0000 (17:02 +0000)
committerRenato Golin <renato.golin@linaro.org>
Fri, 13 Sep 2013 17:02:45 +0000 (17:02 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@190702 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp

index b1cbc23f8140bd42ffa0b8bcc13fe24e70469b43..b0467b5342912c2d3902f4580e8ed1411c8e17df 100644 (file)
@@ -3648,10 +3648,12 @@ public:
   void getDefaultFeatures(llvm::StringMap<bool> &Features) const {
     if (CPU == "arm1136jf-s" || CPU == "arm1176jzf-s" || CPU == "mpcore")
       Features["vfp2"] = true;
-    else if (CPU == "cortex-a8" || CPU == "cortex-a15" ||
-             CPU == "cortex-a9" || CPU == "cortex-a9-mp")
+    else if (CPU == "cortex-a8" || CPU == "cortex-a9" ||
+             CPU == "cortex-a9-mp") {
+      Features["vfp3"] = true;
       Features["neon"] = true;
-    else if (CPU == "swift" || CPU == "cortex-a7") {
+    } else if (CPU == "swift" || CPU == "cortex-a5" ||
+        CPU == "cortex-a7" || CPU == "cortex-a15") {
       Features["vfp4"] = true;
       Features["neon"] = true;
     }
@@ -3702,8 +3704,9 @@ public:
         .Case("arm", true)
         .Case("softfloat", SoftFloat)
         .Case("thumb", IsThumb)
-        .Case("neon", FPU == NeonFPU && !SoftFloat && 
-              StringRef(getCPUDefineSuffix(CPU)).startswith("7"))    
+        .Case("neon", (FPU & NeonFPU) && !SoftFloat &&
+              (StringRef(getCPUDefineSuffix(CPU)).startswith("7") ||
+               StringRef(getCPUDefineSuffix(CPU)).startswith("8")))
         .Default(false);
   }
   // FIXME: Should we actually have some table instead of these switches?