summaryrefslogtreecommitdiffstats
path: root/llvm/include
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/include')
-rw-r--r--llvm/include/llvm/MC/MCInstrDesc.h5
-rw-r--r--llvm/include/llvm/MC/MCSubtargetInfo.h16
-rw-r--r--llvm/include/llvm/MC/SubtargetFeature.h26
3 files changed, 12 insertions, 35 deletions
diff --git a/llvm/include/llvm/MC/MCInstrDesc.h b/llvm/include/llvm/MC/MCInstrDesc.h
index e23a8b61de5..c74d1c3fd86 100644
--- a/llvm/include/llvm/MC/MCInstrDesc.h
+++ b/llvm/include/llvm/MC/MCInstrDesc.h
@@ -144,9 +144,8 @@ public:
const uint16_t *ImplicitUses; // Registers implicitly read by this instr
const uint16_t *ImplicitDefs; // Registers implicitly defined by this instr
const MCOperandInfo *OpInfo; // 'NumOperands' entries about operands
- FeatureBitset
+ uint64_t
DeprecatedFeatureMask; // Feature bits that this is deprecated on, if any
-
// A complex method to determine is a certain is deprecated or not, and return
// the reason for deprecation.
bool (*ComplexDeprecationInfo)(MCInst &, MCSubtargetInfo &, std::string &);
@@ -169,7 +168,7 @@ public:
std::string &Info) const {
if (ComplexDeprecationInfo)
return ComplexDeprecationInfo(MI, STI, Info);
- if ((STI.getFeatureBits() & DeprecatedFeatureMask).any()) {
+ if ((DeprecatedFeatureMask & STI.getFeatureBits()) != 0) {
// FIXME: it would be nice to include the subtarget feature here.
Info = "deprecated";
return true;
diff --git a/llvm/include/llvm/MC/MCSubtargetInfo.h b/llvm/include/llvm/MC/MCSubtargetInfo.h
index 1778a6d13fb..3984a1fb21b 100644
--- a/llvm/include/llvm/MC/MCSubtargetInfo.h
+++ b/llvm/include/llvm/MC/MCSubtargetInfo.h
@@ -42,7 +42,7 @@ class MCSubtargetInfo {
const InstrStage *Stages; // Instruction itinerary stages
const unsigned *OperandCycles; // Itinerary operand cycles
const unsigned *ForwardingPaths; // Forwarding paths
- FeatureBitset FeatureBits; // Feature bits for current CPU + FS
+ uint64_t FeatureBits; // Feature bits for current CPU + FS
public:
void InitMCSubtargetInfo(StringRef TT, StringRef CPU, StringRef FS,
@@ -67,13 +67,13 @@ public:
/// getFeatureBits - Return the feature bits.
///
- const FeatureBitset& getFeatureBits() const {
+ uint64_t getFeatureBits() const {
return FeatureBits;
}
/// setFeatureBits - Set the feature bits.
///
- void setFeatureBits(FeatureBitset& FeatureBits_) { FeatureBits = FeatureBits_; }
+ void setFeatureBits(uint64_t FeatureBits_) { FeatureBits = FeatureBits_; }
/// InitMCProcessorInfo - Set or change the CPU (optionally supplemented with
/// feature string). Recompute feature bits and scheduling model.
@@ -84,15 +84,11 @@ public:
/// ToggleFeature - Toggle a feature and returns the re-computed feature
/// bits. This version does not change the implied bits.
- FeatureBitset ToggleFeature(uint64_t FB);
+ uint64_t ToggleFeature(uint64_t FB);
/// ToggleFeature - Toggle a feature and returns the re-computed feature
- /// bits. This version does not change the implied bits.
- FeatureBitset ToggleFeature(const FeatureBitset& FB);
-
- /// ToggleFeature - Toggle a set of features and returns the re-computed
- /// feature bits. This version will also change all implied bits.
- FeatureBitset ToggleFeature(StringRef FS);
+ /// bits. This version will also change all implied bits.
+ uint64_t ToggleFeature(StringRef FS);
/// getSchedModelForCPU - Get the machine model of a CPU.
///
diff --git a/llvm/include/llvm/MC/SubtargetFeature.h b/llvm/include/llvm/MC/SubtargetFeature.h
index 6a631ffe79b..6f195d7be99 100644
--- a/llvm/include/llvm/MC/SubtargetFeature.h
+++ b/llvm/include/llvm/MC/SubtargetFeature.h
@@ -21,29 +21,11 @@
#include "llvm/ADT/ArrayRef.h"
#include "llvm/ADT/Triple.h"
#include "llvm/Support/DataTypes.h"
-#include <bitset>
namespace llvm {
class raw_ostream;
class StringRef;
-// A container class for subtarget features.
-// This is convenient because std::bitset does not have a constructor
-// with an initializer list of set bits.
-const unsigned MAX_SUBTARGET_FEATURES = 64;
-class FeatureBitset : public std::bitset<MAX_SUBTARGET_FEATURES> {
-public:
- // Cannot inherit constructors because it's not supported by VC++..
- FeatureBitset() : bitset() {}
-
- FeatureBitset(const bitset<MAX_SUBTARGET_FEATURES>& B) : bitset(B) {}
-
- FeatureBitset(std::initializer_list<unsigned> Init) : bitset() {
- for (auto I = Init.begin() , E = Init.end(); I != E; ++I)
- set(*I);
- }
-};
-
//===----------------------------------------------------------------------===//
///
/// SubtargetFeatureKV - Used to provide key value pairs for feature and
@@ -52,8 +34,8 @@ public:
struct SubtargetFeatureKV {
const char *Key; // K-V key string
const char *Desc; // Help descriptor
- FeatureBitset Value; // K-V integer value
- FeatureBitset Implies; // K-V bit mask
+ uint64_t Value; // K-V integer value
+ uint64_t Implies; // K-V bit mask
// Compare routine for std::lower_bound
bool operator<(StringRef S) const {
@@ -100,11 +82,11 @@ public:
/// ToggleFeature - Toggle a feature and returns the newly updated feature
/// bits.
- FeatureBitset ToggleFeature(FeatureBitset Bits, StringRef String,
+ uint64_t ToggleFeature(uint64_t Bits, StringRef String,
ArrayRef<SubtargetFeatureKV> FeatureTable);
/// Get feature bits of a CPU.
- FeatureBitset getFeatureBits(StringRef CPU,
+ uint64_t getFeatureBits(StringRef CPU,
ArrayRef<SubtargetFeatureKV> CPUTable,
ArrayRef<SubtargetFeatureKV> FeatureTable);
OpenPOWER on IntegriCloud