mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-09 11:25:55 +00:00
Revert r158679 - use case is unclear (and it increases the memory footprint).
Original commit message: Allow up to 64 functional units per processor itinerary. This patch changes the type used to hold the FU bitset from unsigned to uint64_t. This will be needed for some upcoming PowerPC itineraries. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@159027 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -42,7 +42,7 @@ class SUnit;
|
|||||||
|
|
||||||
class DFAPacketizer {
|
class DFAPacketizer {
|
||||||
private:
|
private:
|
||||||
typedef std::pair<unsigned, uint64_t> UnsignPair;
|
typedef std::pair<unsigned, unsigned> UnsignPair;
|
||||||
const InstrItineraryData *InstrItins;
|
const InstrItineraryData *InstrItins;
|
||||||
int CurrentState;
|
int CurrentState;
|
||||||
const int (*DFAStateInputTable)[2];
|
const int (*DFAStateInputTable)[2];
|
||||||
|
@@ -39,7 +39,7 @@ class ScoreboardHazardRecognizer : public ScheduleHazardRecognizer {
|
|||||||
// bottom-up scheduler, then the scoreboard cycles are the inverse of the
|
// bottom-up scheduler, then the scoreboard cycles are the inverse of the
|
||||||
// scheduler's cycles.
|
// scheduler's cycles.
|
||||||
class Scoreboard {
|
class Scoreboard {
|
||||||
uint64_t *Data;
|
unsigned *Data;
|
||||||
|
|
||||||
// The maximum number of cycles monitored by the Scoreboard. This
|
// The maximum number of cycles monitored by the Scoreboard. This
|
||||||
// value is determined based on the target itineraries to ensure
|
// value is determined based on the target itineraries to ensure
|
||||||
@@ -54,7 +54,7 @@ class ScoreboardHazardRecognizer : public ScheduleHazardRecognizer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
size_t getDepth() const { return Depth; }
|
size_t getDepth() const { return Depth; }
|
||||||
uint64_t& operator[](size_t idx) const {
|
unsigned& operator[](size_t idx) const {
|
||||||
// Depth is expected to be a power-of-2.
|
// Depth is expected to be a power-of-2.
|
||||||
assert(Depth && !(Depth & (Depth - 1)) &&
|
assert(Depth && !(Depth & (Depth - 1)) &&
|
||||||
"Scoreboard was not initialized properly!");
|
"Scoreboard was not initialized properly!");
|
||||||
@@ -65,7 +65,7 @@ class ScoreboardHazardRecognizer : public ScheduleHazardRecognizer {
|
|||||||
void reset(size_t d = 1) {
|
void reset(size_t d = 1) {
|
||||||
if (Data == NULL) {
|
if (Data == NULL) {
|
||||||
Depth = d;
|
Depth = d;
|
||||||
Data = new uint64_t[Depth];
|
Data = new unsigned[Depth];
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(Data, 0, Depth * sizeof(Data[0]));
|
memset(Data, 0, Depth * sizeof(Data[0]));
|
||||||
|
@@ -62,7 +62,7 @@ struct InstrStage {
|
|||||||
};
|
};
|
||||||
|
|
||||||
unsigned Cycles_; ///< Length of stage in machine cycles
|
unsigned Cycles_; ///< Length of stage in machine cycles
|
||||||
uint64_t Units_; ///< Choice of functional units
|
unsigned Units_; ///< Choice of functional units
|
||||||
int NextCycles_; ///< Number of machine cycles to next stage
|
int NextCycles_; ///< Number of machine cycles to next stage
|
||||||
ReservationKinds Kind_; ///< Kind of the FU reservation
|
ReservationKinds Kind_; ///< Kind of the FU reservation
|
||||||
|
|
||||||
@@ -72,7 +72,7 @@ struct InstrStage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// getUnits - returns the choice of FUs
|
/// getUnits - returns the choice of FUs
|
||||||
uint64_t getUnits() const {
|
unsigned getUnits() const {
|
||||||
return Units_;
|
return Units_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -66,7 +66,7 @@ void DFAPacketizer::ReadTable(unsigned int state) {
|
|||||||
bool DFAPacketizer::canReserveResources(const llvm::MCInstrDesc *MID) {
|
bool DFAPacketizer::canReserveResources(const llvm::MCInstrDesc *MID) {
|
||||||
unsigned InsnClass = MID->getSchedClass();
|
unsigned InsnClass = MID->getSchedClass();
|
||||||
const llvm::InstrStage *IS = InstrItins->beginStage(InsnClass);
|
const llvm::InstrStage *IS = InstrItins->beginStage(InsnClass);
|
||||||
uint64_t FuncUnits = IS->getUnits();
|
unsigned FuncUnits = IS->getUnits();
|
||||||
UnsignPair StateTrans = UnsignPair(CurrentState, FuncUnits);
|
UnsignPair StateTrans = UnsignPair(CurrentState, FuncUnits);
|
||||||
ReadTable(CurrentState);
|
ReadTable(CurrentState);
|
||||||
return (CachedTable.count(StateTrans) != 0);
|
return (CachedTable.count(StateTrans) != 0);
|
||||||
@@ -78,7 +78,7 @@ bool DFAPacketizer::canReserveResources(const llvm::MCInstrDesc *MID) {
|
|||||||
void DFAPacketizer::reserveResources(const llvm::MCInstrDesc *MID) {
|
void DFAPacketizer::reserveResources(const llvm::MCInstrDesc *MID) {
|
||||||
unsigned InsnClass = MID->getSchedClass();
|
unsigned InsnClass = MID->getSchedClass();
|
||||||
const llvm::InstrStage *IS = InstrItins->beginStage(InsnClass);
|
const llvm::InstrStage *IS = InstrItins->beginStage(InsnClass);
|
||||||
uint64_t FuncUnits = IS->getUnits();
|
unsigned FuncUnits = IS->getUnits();
|
||||||
UnsignPair StateTrans = UnsignPair(CurrentState, FuncUnits);
|
UnsignPair StateTrans = UnsignPair(CurrentState, FuncUnits);
|
||||||
ReadTable(CurrentState);
|
ReadTable(CurrentState);
|
||||||
assert(CachedTable.count(StateTrans) != 0);
|
assert(CachedTable.count(StateTrans) != 0);
|
||||||
|
@@ -95,10 +95,10 @@ void ScoreboardHazardRecognizer::Scoreboard::dump() const {
|
|||||||
last--;
|
last--;
|
||||||
|
|
||||||
for (unsigned i = 0; i <= last; i++) {
|
for (unsigned i = 0; i <= last; i++) {
|
||||||
uint64_t FUs = (*this)[i];
|
unsigned FUs = (*this)[i];
|
||||||
dbgs() << "\t";
|
dbgs() << "\t";
|
||||||
for (int j = 63; j >= 0; j--)
|
for (int j = 31; j >= 0; j--)
|
||||||
dbgs() << ((FUs & (1ULL << j)) ? '1' : '0');
|
dbgs() << ((FUs & (1 << j)) ? '1' : '0');
|
||||||
dbgs() << '\n';
|
dbgs() << '\n';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -144,7 +144,7 @@ ScoreboardHazardRecognizer::getHazardType(SUnit *SU, int Stalls) {
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint64_t freeUnits = IS->getUnits();
|
unsigned freeUnits = IS->getUnits();
|
||||||
switch (IS->getReservationKind()) {
|
switch (IS->getReservationKind()) {
|
||||||
case InstrStage::Required:
|
case InstrStage::Required:
|
||||||
// Required FUs conflict with both reserved and required ones
|
// Required FUs conflict with both reserved and required ones
|
||||||
@@ -196,7 +196,7 @@ void ScoreboardHazardRecognizer::EmitInstruction(SUnit *SU) {
|
|||||||
assert(((cycle + i) < RequiredScoreboard.getDepth()) &&
|
assert(((cycle + i) < RequiredScoreboard.getDepth()) &&
|
||||||
"Scoreboard depth exceeded!");
|
"Scoreboard depth exceeded!");
|
||||||
|
|
||||||
uint64_t freeUnits = IS->getUnits();
|
unsigned freeUnits = IS->getUnits();
|
||||||
switch (IS->getReservationKind()) {
|
switch (IS->getReservationKind()) {
|
||||||
case InstrStage::Required:
|
case InstrStage::Required:
|
||||||
// Required FUs conflict with both reserved and required ones
|
// Required FUs conflict with both reserved and required ones
|
||||||
@@ -209,7 +209,7 @@ void ScoreboardHazardRecognizer::EmitInstruction(SUnit *SU) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// reduce to a single unit
|
// reduce to a single unit
|
||||||
uint64_t freeUnit = 0;
|
unsigned freeUnit = 0;
|
||||||
do {
|
do {
|
||||||
freeUnit = freeUnits;
|
freeUnit = freeUnits;
|
||||||
freeUnits = freeUnit & (freeUnit - 1);
|
freeUnits = freeUnit & (freeUnit - 1);
|
||||||
|
@@ -138,7 +138,7 @@ SPUNopFiller::SPUOpPlace
|
|||||||
SPUNopFiller::getOpPlacement( MachineInstr &instr ) {
|
SPUNopFiller::getOpPlacement( MachineInstr &instr ) {
|
||||||
int sc = instr.getDesc().getSchedClass();
|
int sc = instr.getDesc().getSchedClass();
|
||||||
const InstrStage *stage = IID->beginStage(sc);
|
const InstrStage *stage = IID->beginStage(sc);
|
||||||
uint64_t FUs = stage->getUnits();
|
unsigned FUs = stage->getUnits();
|
||||||
SPUOpPlace retval;
|
SPUOpPlace retval;
|
||||||
|
|
||||||
switch( FUs ) {
|
switch( FUs ) {
|
||||||
|
@@ -3183,7 +3183,7 @@ bool HexagonPacketizerList::ignorePseudoInstruction(MachineInstr *MI,
|
|||||||
unsigned SchedClass = TID.getSchedClass();
|
unsigned SchedClass = TID.getSchedClass();
|
||||||
const InstrStage* IS =
|
const InstrStage* IS =
|
||||||
ResourceTracker->getInstrItins()->beginStage(SchedClass);
|
ResourceTracker->getInstrItins()->beginStage(SchedClass);
|
||||||
uint64_t FuncUnits = IS->getUnits();
|
unsigned FuncUnits = IS->getUnits();
|
||||||
return !FuncUnits;
|
return !FuncUnits;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -379,8 +379,8 @@ void SubtargetEmitter::EmitStageAndOperandCycleData(raw_ostream &OS,
|
|||||||
<< "namespace " << Name << "FU {\n";
|
<< "namespace " << Name << "FU {\n";
|
||||||
|
|
||||||
for (unsigned j = 0, FUN = FUs.size(); j < FUN; ++j)
|
for (unsigned j = 0, FUN = FUs.size(); j < FUN; ++j)
|
||||||
OS << " const uint64_t " << FUs[j]->getName()
|
OS << " const unsigned " << FUs[j]->getName()
|
||||||
<< " = 1ULL << " << j << ";\n";
|
<< " = 1 << " << j << ";\n";
|
||||||
|
|
||||||
OS << "}\n";
|
OS << "}\n";
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user