summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan Binkert <nate@binkert.org>2008-09-09 16:27:17 -0700
committerNathan Binkert <nate@binkert.org>2008-09-09 16:27:17 -0700
commit09a8fb0b5263d4b41b8206ce075a3f6923907d65 (patch)
treeb4044a325b57310ff1ba6402677fe8ed132b49eb /src
parent496d3f2789e53a0a394095f741e593491db0453d (diff)
downloadgem5-09a8fb0b5263d4b41b8206ce075a3f6923907d65.tar.xz
style: this file did not conform to style
Diffstat (limited to 'src')
-rw-r--r--src/arch/mips/regfile/int_regfile.cc44
1 files changed, 20 insertions, 24 deletions
diff --git a/src/arch/mips/regfile/int_regfile.cc b/src/arch/mips/regfile/int_regfile.cc
index c46ecf0b3..4ffbcdfb8 100644
--- a/src/arch/mips/regfile/int_regfile.cc
+++ b/src/arch/mips/regfile/int_regfile.cc
@@ -37,7 +37,6 @@
using namespace MipsISA;
using namespace std;
-
void
IntRegFile::clear()
{
@@ -48,25 +47,27 @@ IntRegFile::clear()
void
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;
}
IntReg
IntRegFile::readReg(int intReg)
{
- if(intReg < NumIntRegs)
- { // Regular GPR Read
- DPRINTF(MipsPRA,"Reading Reg: %d, CurrShadowSet: %d\n",intReg,currShadowSet);
- if(intReg >= NumIntArchRegs*NumShadowRegSets){
- return regs[intReg+NumIntRegs*currShadowSet];
- }
- else {
- return regs[(intReg + NumIntArchRegs*currShadowSet) % NumIntArchRegs];
+ if (intReg < NumIntRegs) {
+ // Regular GPR Read
+ DPRINTF(MipsPRA, "Reading Reg: %d, CurrShadowSet: %d\n", intReg,
+ currShadowSet);
+
+ if (intReg >= NumIntArchRegs * NumShadowRegSets) {
+ return regs[intReg + NumIntRegs * currShadowSet];
+ } else {
+ int index = intReg + NumIntArchRegs * currShadowSet;
+ index = index % NumIntArchRegs;
+ return regs[index];
}
- }
- else
- { // Read from shadow GPR .. probably called by RDPGPR
+ } else {
+ // Read from shadow GPR .. probably called by RDPGPR
return regs[intReg];
}
}
@@ -75,20 +76,16 @@ Fault
IntRegFile::setReg(int intReg, const IntReg &val)
{
if (intReg != ZeroReg) {
-
- if(intReg < NumIntRegs)
- {
- if(intReg >= NumIntArchRegs*NumShadowRegSets){
+ if (intReg < NumIntRegs) {
+ if (intReg >= NumIntArchRegs * NumShadowRegSets)
regs[intReg] = val;
- }
- else{
- regs[intReg+NumIntRegs*currShadowSet] = val;
- }
- }
- else{
+ else
+ regs[intReg + NumIntRegs * currShadowSet] = val;
+ } else {
regs[intReg] = val;
}
}
+
return NoFault;
}
@@ -103,4 +100,3 @@ IntRegFile::unserialize(Checkpoint *cp, const std::string &section)
{
UNSERIALIZE_ARRAY(regs, NumIntRegs);
}
-