changeset cdb571ebb4a8 in /z/repo/m5
details: http://repo.m5sim.org/m5?cmd=changeset;node=cdb571ebb4a8
description:
        style: this file did not conform to style

diffstat:

0 files changed

diffs (83 lines):

diff -r bb31ea8583d8 -r cdb571ebb4a8 src/arch/mips/regfile/int_regfile.cc
--- a/src/arch/mips/regfile/int_regfile.cc      Mon Sep 08 18:03:52 2008 -0700
+++ b/src/arch/mips/regfile/int_regfile.cc      Tue Sep 09 16:27:17 2008 -0700
@@ -37,7 +37,6 @@
 using namespace MipsISA;
 using namespace std;
 
-
 void
 IntRegFile::clear()
 {
@@ -48,25 +47,27 @@
 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];
+    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 {
-            return regs[(intReg + NumIntArchRegs*currShadowSet) % 
NumIntArchRegs];
-        }
-    }
-    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 @@
 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 @@
 {
     UNSERIALIZE_ARRAY(regs, NumIntRegs);
 }
-
_______________________________________________
m5-dev mailing list
[email protected]
http://m5sim.org/mailman/listinfo/m5-dev

Reply via email to