Register numbers are decimal. Don't spawn more threads than there are lanes.
This commit is contained in:
@@ -85,17 +85,17 @@ Instruction::InstTableEntry Instruction::instTable[] = {
|
|||||||
|
|
||||||
ostream &Harp::operator<<(ostream& os, Instruction &inst) {
|
ostream &Harp::operator<<(ostream& os, Instruction &inst) {
|
||||||
if (inst.predicated) {
|
if (inst.predicated) {
|
||||||
os << "@p" << inst.pred << " ? ";
|
os << "@p" << dec << inst.pred << " ? ";
|
||||||
}
|
}
|
||||||
|
|
||||||
os << Instruction::instTable[inst.op].opString << ' ';
|
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 << ' ';
|
if (inst.pdestPresent) os << "@p" << inst.pdest << ' ';
|
||||||
for (int i = 0; i < inst.nRsrc; i++) {
|
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++) {
|
for (int i = 0; i < inst.nPsrc; i++) {
|
||||||
os << "@p" << inst.psrc[i] << ' ';
|
os << "@p" << dec << inst.psrc[i] << ' ';
|
||||||
}
|
}
|
||||||
if (inst.immsrcPresent) {
|
if (inst.immsrcPresent) {
|
||||||
if (inst.refLiteral) os << inst.refLiteral->name;
|
if (inst.refLiteral) os << inst.refLiteral->name;
|
||||||
@@ -288,4 +288,9 @@ void Instruction::executeOn(Core &c) {
|
|||||||
D(3, "End instruction execute.");
|
D(3, "End instruction execute.");
|
||||||
|
|
||||||
c.activeThreads = nextActiveThreads;
|
c.activeThreads = nextActiveThreads;
|
||||||
|
if (nextActiveThreads > c.reg.size()) {
|
||||||
|
cerr << "Error: attempt to spawn " << nextActiveThreads << " threads. "
|
||||||
|
<< c.reg.size() << " available.\n";
|
||||||
|
abort();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user