summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/SubtargetFeature.cpp
diff options
context:
space:
mode:
authorEvan Cheng <evan.cheng@apple.com>2011-04-15 19:35:46 +0000
committerEvan Cheng <evan.cheng@apple.com>2011-04-15 19:35:46 +0000
commita2e61292f06051adb1bfd853aeecafae1ea15c4d (patch)
tree9be8fbae24547f4e4da0cbe6f5d7b9a56f71b0b2 /llvm/lib/Target/SubtargetFeature.cpp
parent375249a417cd058c8a057b706c82915a767e85d4 (diff)
downloadbcm5719-llvm-a2e61292f06051adb1bfd853aeecafae1ea15c4d.tar.gz
bcm5719-llvm-a2e61292f06051adb1bfd853aeecafae1ea15c4d.zip
Increase SubtargetFeatureKV Value and Implies fields to 64 bits since some targets are getting very close to 32 subtarget features. Also teach tablegen to error when there are more than 64 features to guard against undefined behavior. rdar://9282332
llvm-svn: 129590
Diffstat (limited to 'llvm/lib/Target/SubtargetFeature.cpp')
-rw-r--r--llvm/lib/Target/SubtargetFeature.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/llvm/lib/Target/SubtargetFeature.cpp b/llvm/lib/Target/SubtargetFeature.cpp
index 3cf95b57c5d..e0a9de82983 100644
--- a/llvm/lib/Target/SubtargetFeature.cpp
+++ b/llvm/lib/Target/SubtargetFeature.cpp
@@ -211,7 +211,7 @@ const std::string & SubtargetFeatures::getCPU() const {
/// feature, set it.
///
static
-void SetImpliedBits(uint32_t &Bits, const SubtargetFeatureKV *FeatureEntry,
+void SetImpliedBits(uint64_t &Bits, const SubtargetFeatureKV *FeatureEntry,
const SubtargetFeatureKV *FeatureTable,
size_t FeatureTableSize) {
for (size_t i = 0; i < FeatureTableSize; ++i) {
@@ -230,7 +230,7 @@ void SetImpliedBits(uint32_t &Bits, const SubtargetFeatureKV *FeatureEntry,
/// feature, clear it.
///
static
-void ClearImpliedBits(uint32_t &Bits, const SubtargetFeatureKV *FeatureEntry,
+void ClearImpliedBits(uint64_t &Bits, const SubtargetFeatureKV *FeatureEntry,
const SubtargetFeatureKV *FeatureTable,
size_t FeatureTableSize) {
for (size_t i = 0; i < FeatureTableSize; ++i) {
@@ -247,7 +247,7 @@ void ClearImpliedBits(uint32_t &Bits, const SubtargetFeatureKV *FeatureEntry,
/// getBits - Get feature bits.
///
-uint32_t SubtargetFeatures::getBits(const SubtargetFeatureKV *CPUTable,
+uint64_t SubtargetFeatures::getBits(const SubtargetFeatureKV *CPUTable,
size_t CPUTableSize,
const SubtargetFeatureKV *FeatureTable,
size_t FeatureTableSize) {
@@ -263,7 +263,7 @@ uint32_t SubtargetFeatures::getBits(const SubtargetFeatureKV *CPUTable,
"CPU features table is not sorted");
}
#endif
- uint32_t Bits = 0; // Resulting bits
+ uint64_t Bits = 0; // Resulting bits
// Check if help is needed
if (Features[0] == "help")
OpenPOWER on IntegriCloud