style: this file did not conform to style

This commit is contained in:
Nathan Binkert 2008-09-09 16:27:17 -07:00
parent 496d3f2789
commit 09a8fb0b52

View file

@ -37,7 +37,6 @@
using namespace MipsISA; using namespace MipsISA;
using namespace std; using namespace std;
void void
IntRegFile::clear() IntRegFile::clear()
{ {
@ -48,25 +47,27 @@ IntRegFile::clear()
void void
IntRegFile::setShadowSet(int css) IntRegFile::setShadowSet(int css)
{ {
DPRINTF(MipsPRA,"Setting Shadow Set to :%d (%s)\n",css,currShadowSet); DPRINTF(MipsPRA, "Setting Shadow Set to :%d (%s)\n", css, currShadowSet);
currShadowSet = css; currShadowSet = css;
} }
IntReg IntReg
IntRegFile::readReg(int intReg) IntRegFile::readReg(int intReg)
{ {
if(intReg < NumIntRegs) if (intReg < NumIntRegs) {
{ // Regular GPR Read // Regular GPR Read
DPRINTF(MipsPRA,"Reading Reg: %d, CurrShadowSet: %d\n",intReg,currShadowSet); DPRINTF(MipsPRA, "Reading Reg: %d, CurrShadowSet: %d\n", intReg,
if(intReg >= NumIntArchRegs*NumShadowRegSets){ currShadowSet);
return regs[intReg+NumIntRegs*currShadowSet];
if (intReg >= NumIntArchRegs * NumShadowRegSets) {
return regs[intReg + NumIntRegs * currShadowSet];
} else {
int index = intReg + NumIntArchRegs * currShadowSet;
index = index % NumIntArchRegs;
return regs[index];
} }
else { } else {
return regs[(intReg + NumIntArchRegs*currShadowSet) % NumIntArchRegs]; // Read from shadow GPR .. probably called by RDPGPR
}
}
else
{ // Read from shadow GPR .. probably called by RDPGPR
return regs[intReg]; return regs[intReg];
} }
} }
@ -75,20 +76,16 @@ Fault
IntRegFile::setReg(int intReg, const IntReg &val) IntRegFile::setReg(int intReg, const IntReg &val)
{ {
if (intReg != ZeroReg) { if (intReg != ZeroReg) {
if (intReg < NumIntRegs) {
if(intReg < NumIntRegs) if (intReg >= NumIntArchRegs * NumShadowRegSets)
{
if(intReg >= NumIntArchRegs*NumShadowRegSets){
regs[intReg] = val; regs[intReg] = val;
} else
else{ regs[intReg + NumIntRegs * currShadowSet] = val;
regs[intReg+NumIntRegs*currShadowSet] = val; } else {
}
}
else{
regs[intReg] = val; regs[intReg] = val;
} }
} }
return NoFault; return NoFault;
} }
@ -103,4 +100,3 @@ IntRegFile::unserialize(Checkpoint *cp, const std::string &section)
{ {
UNSERIALIZE_ARRAY(regs, NumIntRegs); UNSERIALIZE_ARRAY(regs, NumIntRegs);
} }