Use std::bitset for SubtargetFeatures

Previously, subtarget features were a bitfield with the underlying type being uint64_t. 
Since several targets (X86 and ARM, in particular) have hit or were very close to hitting this bound, switching the features to use a bitset.

No functional change.

Differential Revision: http://reviews.llvm.org/D7065

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@229831 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Michael Kuperstein
2015-02-19 09:01:04 +00:00
parent d6f86b8614
commit 23dd089d8f
33 changed files with 356 additions and 328 deletions

View File

@@ -80,20 +80,19 @@ X86GenericDisassembler::X86GenericDisassembler(
MCContext &Ctx,
std::unique_ptr<const MCInstrInfo> MII)
: MCDisassembler(STI, Ctx), MII(std::move(MII)) {
switch (STI.getFeatureBits() &
(X86::Mode16Bit | X86::Mode32Bit | X86::Mode64Bit)) {
case X86::Mode16Bit:
const FeatureBitset &FB = STI.getFeatureBits();
if (FB[X86::Mode16Bit]) {
fMode = MODE_16BIT;
break;
case X86::Mode32Bit:
return;
} else if (FB[X86::Mode32Bit]) {
fMode = MODE_32BIT;
break;
case X86::Mode64Bit:
return;
} else if (FB[X86::Mode64Bit]) {
fMode = MODE_64BIT;
break;
default:
llvm_unreachable("Invalid CPU mode");
return;
}
llvm_unreachable("Invalid CPU mode");
}
struct Region {