]> granicus.if.org Git - clang/commitdiff
Cortex-M3 and Cortex-M4 should not enable hwdiv-arm
authorArtyom Skrobov <Artyom.Skrobov@arm.com>
Mon, 27 Jan 2014 18:44:25 +0000 (18:44 +0000)
committerArtyom Skrobov <Artyom.Skrobov@arm.com>
Mon, 27 Jan 2014 18:44:25 +0000 (18:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200233 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Basic/Targets.cpp
test/Driver/arm-cortex-cpus.c

index 94c8ea959896a6feaed309613e6be032c49e5a99..b313ac44b2d36fe65301df6ec34087a2cd3a864d 100644 (file)
@@ -3832,14 +3832,15 @@ public:
       Features["hwdiv"] = true;
       Features["hwdiv-arm"] = true;
       Features["crc"] = true;
-    } else if (CPU == "cortex-r5" || CPU == "cortex-m3" ||
-               CPU == "cortex-m4" ||
+    } else if (CPU == "cortex-r5" ||
                // Enable the hwdiv extension for all v8a AArch32 cores by
                // default.
                ArchName == "armv8a" || ArchName == "armv8" ||
                ArchName == "thumbv8a" || ArchName == "thumbv8") {
       Features["hwdiv"] = true;
       Features["hwdiv-arm"] = true;
+    } else if (CPU == "cortex-m3" || CPU == "cortex-m4") {
+      Features["hwdiv"] = true;
     }
   }
 
index ddfbc6e58c90a65d6ea43fc2a8fc296efb6762f3..80c0f10aa00d7bef1e2338f7b70f4335f5ca2877 100644 (file)
 // RUN: %clang -target arm -mcpu=cortex-a53 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s
 // RUN: %clang -target arm -mcpu=cortex-a57 -mthumb -### -c %s 2>&1 | FileCheck -check-prefix=CHECK-CPUV8A-THUMB %s
 // CHECK-CPUV8A-THUMB: "-cc1"{{.*}} "-triple" "thumbv8-{{.*}}
+
+// ================== Check that Cortex-M cores don't enable hwdiv-arm (and don't emit Tag_DIV_use)
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m3 -S %s -o - | FileCheck -check-prefix=CHECK-HWDIV-ARM %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m4 -S %s -o - | FileCheck -check-prefix=CHECK-HWDIV-ARM %s
+// CHECK-HWDIV-ARM-NOT: .eabi_attribute        44
+