Register numbers are decimal. Don't spawn more threads than there are lanes.

This commit is contained in:
chad 2013-10-13 21:14:03 -04:00
parent d7352c02d1
commit cfbbc665fd

View file

@ -85,17 +85,17 @@ Instruction::InstTableEntry Instruction::instTable[] = {
ostream &Harp::operator<<(ostream& os, Instruction &inst) {
if (inst.predicated) {
os << "@p" << inst.pred << " ? ";
os << "@p" << dec << inst.pred << " ? ";
}
os << Instruction::instTable[inst.op].opString << ' ';
if (inst.rdestPresent) os << "%r" << inst.rdest << ' ';
if (inst.rdestPresent) os << "%r" << dec << inst.rdest << ' ';
if (inst.pdestPresent) os << "@p" << inst.pdest << ' ';
for (int i = 0; i < inst.nRsrc; i++) {
os << "%r" << inst.rsrc[i] << ' ';
os << "%r" << dec << inst.rsrc[i] << ' ';
}
for (int i = 0; i < inst.nPsrc; i++) {
os << "@p" << inst.psrc[i] << ' ';
os << "@p" << dec << inst.psrc[i] << ' ';
}
if (inst.immsrcPresent) {
if (inst.refLiteral) os << inst.refLiteral->name;
@ -288,4 +288,9 @@ void Instruction::executeOn(Core &c) {
D(3, "End instruction execute.");
c.activeThreads = nextActiveThreads;
if (nextActiveThreads > c.reg.size()) {
cerr << "Error: attempt to spawn " << nextActiveThreads << " threads. "
<< c.reg.size() << " available.\n";
abort();
}
}