diff options
| author | Artyom Skrobov <Artyom.Skrobov@arm.com> | 2014-01-29 09:43:07 +0000 |
|---|---|---|
| committer | Artyom Skrobov <Artyom.Skrobov@arm.com> | 2014-01-29 09:43:07 +0000 |
| commit | e72a6f7a70879e6b9e35f30823c51a08244c0e18 (patch) | |
| tree | ebb9c70cfc0d33f7ba7c244eab4dc94ad81353a6 /clang | |
| parent | 71788fac2aef064fd3f2ca5401dc59b84717b127 (diff) | |
| download | bcm5719-llvm-e72a6f7a70879e6b9e35f30823c51a08244c0e18.tar.gz bcm5719-llvm-e72a6f7a70879e6b9e35f30823c51a08244c0e18.zip | |
Cortex-M3 and Cortex-M4 should not enable hwdiv-arm (committing again, with an updated test)
llvm-svn: 200385
Diffstat (limited to 'clang')
| -rw-r--r-- | clang/lib/Basic/Targets.cpp | 5 | ||||
| -rw-r--r-- | clang/test/CodeGen/arm-cortex-cpus.c | 11 |
2 files changed, 14 insertions, 2 deletions
diff --git a/clang/lib/Basic/Targets.cpp b/clang/lib/Basic/Targets.cpp index 94c8ea95989..b313ac44b2d 100644 --- a/clang/lib/Basic/Targets.cpp +++ b/clang/lib/Basic/Targets.cpp @@ -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; } } diff --git a/clang/test/CodeGen/arm-cortex-cpus.c b/clang/test/CodeGen/arm-cortex-cpus.c new file mode 100644 index 00000000000..d8d9830e5e0 --- /dev/null +++ b/clang/test/CodeGen/arm-cortex-cpus.c @@ -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 + |

