IntReg IntRegFile::readReg(int intReg)
{
- IntReg val =
- regView[intReg >> FrameOffsetBits][intReg & FrameOffsetMask];
+ IntReg val;
+ if(intReg < NumRegularIntRegs)
+ val = regView[intReg >> FrameOffsetBits][intReg & FrameOffsetMask];
+ else if((intReg -= NumRegularIntRegs) < NumMicroIntRegs)
+ val = microRegs[intReg];
+ else
+ panic("Tried to read non-existant integer register\n");
+
DPRINTF(Sparc, "Read register %d = 0x%x\n", intReg, val);
return val;
}
if(intReg)
{
DPRINTF(Sparc, "Wrote register %d = 0x%x\n", intReg, val);
- regView[intReg >> FrameOffsetBits][intReg & FrameOffsetMask] = val;
+ if(intReg < NumRegularIntRegs)
+ regView[intReg >> FrameOffsetBits][intReg & FrameOffsetMask] = val;
+ else if((intReg -= NumRegularIntRegs) < NumMicroIntRegs)
+ microRegs[intReg] = val;
+ else
+ panic("Tried to set non-existant integer register\n");
}
return NoFault;
}
SERIALIZE_ARRAY(regGlobals[x], RegsPerFrame);
for(x = 0; x < 2 * NWindows; x++)
SERIALIZE_ARRAY(regSegments[x], RegsPerFrame);
+ SERIALIZE_ARRAY(microRegs, NumMicroIntRegs);
}
void IntRegFile::unserialize(Checkpoint *cp, const std::string §ion)
UNSERIALIZE_ARRAY(regGlobals[x], RegsPerFrame);
for(unsigned int x = 0; x < 2 * NWindows; x++)
UNSERIALIZE_ARRAY(regSegments[x], RegsPerFrame);
+ UNSERIALIZE_ARRAY(microRegs, NumMicroIntRegs);
}
IntReg regGlobals[MaxGL][RegsPerFrame];
IntReg regSegments[2 * NWindows][RegsPerFrame];
+ IntReg microRegs[NumMicroIntRegs];
enum regFrame {Globals, Outputs, Locals, Inputs, NumFrames};
'RdHigh': ('IntReg', 'udw', 'RD | 1', 'IsInteger', 3),
'Rs1': ('IntReg', 'udw', 'RS1', 'IsInteger', 4),
'Rs2': ('IntReg', 'udw', 'RS2', 'IsInteger', 5),
+ 'uReg0': ('IntReg', 'udw', 'NumRegularIntRegs+0', 'IsInteger', 6),
'Frds': ('FloatReg', 'sf', 'RD', 'IsFloating', 10),
'Frd': ('FloatReg', 'df', 'dfpr(RD)', 'IsFloating', 10),
# Each Frd_N refers to the Nth double precision register from Frd.
//This makes sure the big endian versions of certain functions are used.
using namespace BigEndianGuest;
- // SPARC have a delay slot
+ // SPARC has a delay slot
#define ISA_HAS_DELAY_SLOT 1
// SPARC NOP (sethi %(hi(0), g0)
const MachInst NoopMachInst = 0x01000000;
- const int NumIntRegs = 32;
+ const int NumRegularIntRegs = 32;
+ const int NumMicroIntRegs = 1;
+ const int NumIntRegs =
+ NumRegularIntRegs +
+ NumMicroIntRegs;
const int NumFloatRegs = 64;
const int NumMiscRegs = 40;