mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-06-25 00:24:26 +00:00
Revert "Use std::bitset for SubtargetFeatures"
This reverts commit r233055. It still causes buildbot failures (gcc running out of memory on several platforms, and a self-host failure on arm), although less than the previous time. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@233068 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@ -10,7 +10,6 @@
|
||||
#ifndef LLVM_MC_MCINSTPRINTER_H
|
||||
#define LLVM_MC_MCINSTPRINTER_H
|
||||
|
||||
#include "llvm/MC/SubtargetFeature.h"
|
||||
#include "llvm/Support/DataTypes.h"
|
||||
#include "llvm/Support/Format.h"
|
||||
|
||||
@ -42,7 +41,7 @@ protected:
|
||||
const MCRegisterInfo &MRI;
|
||||
|
||||
/// The current set of available features.
|
||||
FeatureBitset AvailableFeatures;
|
||||
uint64_t AvailableFeatures;
|
||||
|
||||
/// True if we are printing marked up assembly.
|
||||
bool UseMarkup;
|
||||
@ -59,7 +58,7 @@ public:
|
||||
MCInstPrinter(const MCAsmInfo &mai, const MCInstrInfo &mii,
|
||||
const MCRegisterInfo &mri)
|
||||
: CommentStream(nullptr), MAI(mai), MII(mii), MRI(mri),
|
||||
AvailableFeatures(), UseMarkup(0), PrintImmHex(0),
|
||||
AvailableFeatures(0), UseMarkup(0), PrintImmHex(0),
|
||||
PrintHexStyle(HexStyle::C) {}
|
||||
|
||||
virtual ~MCInstPrinter();
|
||||
@ -79,8 +78,8 @@ public:
|
||||
/// printRegName - Print the assembler register name.
|
||||
virtual void printRegName(raw_ostream &OS, unsigned RegNo) const;
|
||||
|
||||
const FeatureBitset& getAvailableFeatures() const { return AvailableFeatures; }
|
||||
void setAvailableFeatures(const FeatureBitset& Value) { AvailableFeatures = Value; }
|
||||
uint64_t getAvailableFeatures() const { return AvailableFeatures; }
|
||||
void setAvailableFeatures(uint64_t Value) { AvailableFeatures = Value; }
|
||||
|
||||
bool getUseMarkup() const { return UseMarkup; }
|
||||
void setUseMarkup(bool Value) { UseMarkup = Value; }
|
||||
|
@ -150,7 +150,7 @@ 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 DeprecatedFeatureMask; // Feature bits that this is deprecated on, if any
|
||||
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 &);
|
||||
@ -173,7 +173,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;
|
||||
|
@ -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.
|
||||
///
|
||||
|
@ -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);
|
||||
|
||||
|
Reference in New Issue
Block a user