r200385 - Cortex-M3 and Cortex-M4 should not enable hwdiv-arm (committing again, with an updated test)
Artyom Skrobov
Artyom.Skrobov at arm.com
Wed Jan 29 01:43:07 PST 2014
Author: askrobov
Date: Wed Jan 29 03:43:07 2014
New Revision: 200385
URL: http://llvm.org/viewvc/llvm-project?rev=200385&view=rev
Log:
Cortex-M3 and Cortex-M4 should not enable hwdiv-arm (committing again, with an updated test)
Added:
cfe/trunk/test/CodeGen/arm-cortex-cpus.c
Modified:
cfe/trunk/lib/Basic/Targets.cpp
Modified: cfe/trunk/lib/Basic/Targets.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Basic/Targets.cpp?rev=200385&r1=200384&r2=200385&view=diff
==============================================================================
--- cfe/trunk/lib/Basic/Targets.cpp (original)
+++ cfe/trunk/lib/Basic/Targets.cpp Wed Jan 29 03:43:07 2014
@@ -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;
}
}
Added: cfe/trunk/test/CodeGen/arm-cortex-cpus.c
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/test/CodeGen/arm-cortex-cpus.c?rev=200385&view=auto
==============================================================================
--- cfe/trunk/test/CodeGen/arm-cortex-cpus.c (added)
+++ cfe/trunk/test/CodeGen/arm-cortex-cpus.c Wed Jan 29 03:43:07 2014
@@ -0,0 +1,11 @@
+// REQUIRES: arm-registered-target
+
+// Check that Cortex-M cores don't enable hwdiv-arm (and don't emit Tag_DIV_use)
+//
+// This target feature doesn't affect C predefines, nor the generated IR;
+// only the build attributes in generated assembly and object files are affected.
+
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m3 -S %s -o - | FileCheck %s
+// RUN: %clang -target arm-linux-gnueabi -mcpu=cortex-m4 -S %s -o - | FileCheck %s
+// CHECK-NOT: .eabi_attribute 44
+
More information about the cfe-commits
mailing list