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.

llvm-svn: 158679
This commit is contained in:
Hal Finkel 2012-06-18 21:08:18 +00:00
parent 920ceddf80
commit 8eac009633
8 changed files with 17 additions and 17 deletions

View File

@ -42,7 +42,7 @@ class SUnit;
class DFAPacketizer {
private:
typedef std::pair<unsigned, unsigned> UnsignPair;
typedef std::pair<unsigned, uint64_t> UnsignPair;
const InstrItineraryData *InstrItins;
int CurrentState;
const int (*DFAStateInputTable)[2];

View File

@ -39,7 +39,7 @@ class ScoreboardHazardRecognizer : public ScheduleHazardRecognizer {
// bottom-up scheduler, then the scoreboard cycles are the inverse of the
// scheduler's cycles.
class Scoreboard {
unsigned *Data;
uint64_t *Data;
// The maximum number of cycles monitored by the Scoreboard. This
// value is determined based on the target itineraries to ensure
@ -54,7 +54,7 @@ class ScoreboardHazardRecognizer : public ScheduleHazardRecognizer {
}
size_t getDepth() const { return Depth; }
unsigned& operator[](size_t idx) const {
uint64_t& operator[](size_t idx) const {
// Depth is expected to be a power-of-2.
assert(Depth && !(Depth & (Depth - 1)) &&
"Scoreboard was not initialized properly!");
@ -65,7 +65,7 @@ class ScoreboardHazardRecognizer : public ScheduleHazardRecognizer {
void reset(size_t d = 1) {
if (Data == NULL) {
Depth = d;
Data = new unsigned[Depth];
Data = new uint64_t[Depth];
}
memset(Data, 0, Depth * sizeof(Data[0]));

View File

@ -62,7 +62,7 @@ struct InstrStage {
};
unsigned Cycles_; ///< Length of stage in machine cycles
unsigned Units_; ///< Choice of functional units
uint64_t Units_; ///< Choice of functional units
int NextCycles_; ///< Number of machine cycles to next stage
ReservationKinds Kind_; ///< Kind of the FU reservation
@ -72,7 +72,7 @@ struct InstrStage {
}
/// getUnits - returns the choice of FUs
unsigned getUnits() const {
uint64_t getUnits() const {
return Units_;
}

View File

@ -66,7 +66,7 @@ void DFAPacketizer::ReadTable(unsigned int state) {
bool DFAPacketizer::canReserveResources(const llvm::MCInstrDesc *MID) {
unsigned InsnClass = MID->getSchedClass();
const llvm::InstrStage *IS = InstrItins->beginStage(InsnClass);
unsigned FuncUnits = IS->getUnits();
uint64_t FuncUnits = IS->getUnits();
UnsignPair StateTrans = UnsignPair(CurrentState, FuncUnits);
ReadTable(CurrentState);
return (CachedTable.count(StateTrans) != 0);
@ -78,7 +78,7 @@ bool DFAPacketizer::canReserveResources(const llvm::MCInstrDesc *MID) {
void DFAPacketizer::reserveResources(const llvm::MCInstrDesc *MID) {
unsigned InsnClass = MID->getSchedClass();
const llvm::InstrStage *IS = InstrItins->beginStage(InsnClass);
unsigned FuncUnits = IS->getUnits();
uint64_t FuncUnits = IS->getUnits();
UnsignPair StateTrans = UnsignPair(CurrentState, FuncUnits);
ReadTable(CurrentState);
assert(CachedTable.count(StateTrans) != 0);

View File

@ -95,9 +95,9 @@ void ScoreboardHazardRecognizer::Scoreboard::dump() const {
last--;
for (unsigned i = 0; i <= last; i++) {
unsigned FUs = (*this)[i];
uint64_t FUs = (*this)[i];
dbgs() << "\t";
for (int j = 31; j >= 0; j--)
for (int j = 63; j >= 0; j--)
dbgs() << ((FUs & (1 << j)) ? '1' : '0');
dbgs() << '\n';
}
@ -144,7 +144,7 @@ ScoreboardHazardRecognizer::getHazardType(SUnit *SU, int Stalls) {
break;
}
unsigned freeUnits = IS->getUnits();
uint64_t freeUnits = IS->getUnits();
switch (IS->getReservationKind()) {
case InstrStage::Required:
// Required FUs conflict with both reserved and required ones
@ -196,7 +196,7 @@ void ScoreboardHazardRecognizer::EmitInstruction(SUnit *SU) {
assert(((cycle + i) < RequiredScoreboard.getDepth()) &&
"Scoreboard depth exceeded!");
unsigned freeUnits = IS->getUnits();
uint64_t freeUnits = IS->getUnits();
switch (IS->getReservationKind()) {
case InstrStage::Required:
// Required FUs conflict with both reserved and required ones
@ -209,7 +209,7 @@ void ScoreboardHazardRecognizer::EmitInstruction(SUnit *SU) {
}
// reduce to a single unit
unsigned freeUnit = 0;
uint64_t freeUnit = 0;
do {
freeUnit = freeUnits;
freeUnits = freeUnit & (freeUnit - 1);

View File

@ -138,7 +138,7 @@ SPUNopFiller::SPUOpPlace
SPUNopFiller::getOpPlacement( MachineInstr &instr ) {
int sc = instr.getDesc().getSchedClass();
const InstrStage *stage = IID->beginStage(sc);
unsigned FUs = stage->getUnits();
uint64_t FUs = stage->getUnits();
SPUOpPlace retval;
switch( FUs ) {

View File

@ -3183,7 +3183,7 @@ bool HexagonPacketizerList::ignorePseudoInstruction(MachineInstr *MI,
unsigned SchedClass = TID.getSchedClass();
const InstrStage* IS =
ResourceTracker->getInstrItins()->beginStage(SchedClass);
unsigned FuncUnits = IS->getUnits();
uint64_t FuncUnits = IS->getUnits();
return !FuncUnits;
}

View File

@ -379,8 +379,8 @@ void SubtargetEmitter::EmitStageAndOperandCycleData(raw_ostream &OS,
<< "namespace " << Name << "FU {\n";
for (unsigned j = 0, FUN = FUs.size(); j < FUN; ++j)
OS << " const unsigned " << FUs[j]->getName()
<< " = 1 << " << j << ";\n";
OS << " const uint64_t " << FUs[j]->getName()
<< " = 1ULL << " << j << ";\n";
OS << "}\n";