Cortex-M3 and Cortex-M4 should not enable hwdiv-arm (committing again, with an updated test)

llvm-svn: 200385
This commit is contained in:
Artyom Skrobov 2014-01-29 09:43:07 +00:00
parent 71788fac2a
commit e72a6f7a70
2 changed files with 14 additions and 2 deletions

View 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;
}
}

View File

@ -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