class DFAPacketizer {
private:
- typedef std::pair<unsigned, uint64_t> UnsignPair;
+ typedef std::pair<unsigned, unsigned> UnsignPair;
const InstrItineraryData *InstrItins;
int CurrentState;
const int (*DFAStateInputTable)[2];
// bottom-up scheduler, then the scoreboard cycles are the inverse of the
// scheduler's cycles.
class Scoreboard {
- uint64_t *Data;
+ unsigned *Data;
// The maximum number of cycles monitored by the Scoreboard. This
// value is determined based on the target itineraries to ensure
}
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.
assert(Depth && !(Depth & (Depth - 1)) &&
"Scoreboard was not initialized properly!");
void reset(size_t d = 1) {
if (Data == NULL) {
Depth = d;
- Data = new uint64_t[Depth];
+ Data = new unsigned[Depth];
}
memset(Data, 0, Depth * sizeof(Data[0]));
};
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
ReservationKinds Kind_; ///< Kind of the FU reservation
}
/// getUnits - returns the choice of FUs
- uint64_t getUnits() const {
+ unsigned getUnits() const {
return Units_;
}
bool DFAPacketizer::canReserveResources(const llvm::MCInstrDesc *MID) {
unsigned InsnClass = MID->getSchedClass();
const llvm::InstrStage *IS = InstrItins->beginStage(InsnClass);
- uint64_t FuncUnits = IS->getUnits();
+ unsigned FuncUnits = IS->getUnits();
UnsignPair StateTrans = UnsignPair(CurrentState, FuncUnits);
ReadTable(CurrentState);
return (CachedTable.count(StateTrans) != 0);
void DFAPacketizer::reserveResources(const llvm::MCInstrDesc *MID) {
unsigned InsnClass = MID->getSchedClass();
const llvm::InstrStage *IS = InstrItins->beginStage(InsnClass);
- uint64_t FuncUnits = IS->getUnits();
+ unsigned FuncUnits = IS->getUnits();
UnsignPair StateTrans = UnsignPair(CurrentState, FuncUnits);
ReadTable(CurrentState);
assert(CachedTable.count(StateTrans) != 0);
last--;
for (unsigned i = 0; i <= last; i++) {
- uint64_t FUs = (*this)[i];
+ unsigned FUs = (*this)[i];
dbgs() << "\t";
- for (int j = 63; j >= 0; j--)
- dbgs() << ((FUs & (1ULL << j)) ? '1' : '0');
+ for (int j = 31; j >= 0; j--)
+ dbgs() << ((FUs & (1 << j)) ? '1' : '0');
dbgs() << '\n';
}
}
break;
}
- uint64_t freeUnits = IS->getUnits();
+ unsigned freeUnits = IS->getUnits();
switch (IS->getReservationKind()) {
case InstrStage::Required:
// Required FUs conflict with both reserved and required ones
assert(((cycle + i) < RequiredScoreboard.getDepth()) &&
"Scoreboard depth exceeded!");
- uint64_t freeUnits = IS->getUnits();
+ unsigned freeUnits = IS->getUnits();
switch (IS->getReservationKind()) {
case InstrStage::Required:
// Required FUs conflict with both reserved and required ones
}
// reduce to a single unit
- uint64_t freeUnit = 0;
+ unsigned freeUnit = 0;
do {
freeUnit = freeUnits;
freeUnits = freeUnit & (freeUnit - 1);
SPUNopFiller::getOpPlacement( MachineInstr &instr ) {
int sc = instr.getDesc().getSchedClass();
const InstrStage *stage = IID->beginStage(sc);
- uint64_t FUs = stage->getUnits();
+ unsigned FUs = stage->getUnits();
SPUOpPlace retval;
switch( FUs ) {
unsigned SchedClass = TID.getSchedClass();
const InstrStage* IS =
ResourceTracker->getInstrItins()->beginStage(SchedClass);
- uint64_t FuncUnits = IS->getUnits();
+ unsigned FuncUnits = IS->getUnits();
return !FuncUnits;
}
<< "namespace " << Name << "FU {\n";
for (unsigned j = 0, FUN = FUs.size(); j < FUN; ++j)
- OS << " const uint64_t " << FUs[j]->getName()
- << " = 1ULL << " << j << ";\n";
+ OS << " const unsigned " << FUs[j]->getName()
+ << " = 1 << " << j << ";\n";
OS << "}\n";