summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPierre Bourdon <delroth@gmail.com>2014-05-25 22:57:51 +0200
committerPierre Bourdon <delroth@gmail.com>2014-05-25 22:59:51 +0200
commit3a76c0c8f5dea062a8ba6cf7bb02af30903aba2a (patch)
tree5562fb1fd8608539d3452f50c5a8aced33456216
parent010ca048dff77340024987cfd341e82e0a02b879 (diff)
PowerPC: Get rid of the 'cr' field which was obsoleted by the new 'cr_fast'
-rw-r--r--Source/Core/Core/PowerPC/PowerPC.cpp9
-rw-r--r--Source/Core/Core/PowerPC/PowerPC.h11
2 files changed, 8 insertions, 12 deletions
diff --git a/Source/Core/Core/PowerPC/PowerPC.cpp b/Source/Core/Core/PowerPC/PowerPC.cpp
index 2b2e1dda37..18f00cdfca 100644
--- a/Source/Core/Core/PowerPC/PowerPC.cpp
+++ b/Source/Core/Core/PowerPC/PowerPC.cpp
@@ -39,21 +39,21 @@ BreakPoints breakpoints;
MemChecks memchecks;
PPCDebugInterface debug_interface;
-void CompactCR()
+u32 CompactCR()
{
u32 new_cr = ppcState.cr_fast[0] << 28;
for (int i = 1; i < 8; i++)
{
new_cr |= ppcState.cr_fast[i] << (28 - i * 4);
}
- ppcState.cr = new_cr;
+ return new_cr;
}
-void ExpandCR()
+void ExpandCR(u32 cr)
{
for (int i = 0; i < 8; i++)
{
- ppcState.cr_fast[i] = (ppcState.cr >> (28 - i * 4)) & 0xF;
+ ppcState.cr_fast[i] = (cr >> (28 - i * 4)) & 0xF;
}
}
@@ -95,7 +95,6 @@ void ResetRegisters()
ppcState.spr[SPR_ECID_M] = 0x1840c00d;
ppcState.spr[SPR_ECID_L] = 0x82bb08e8;
- ppcState.cr = 0;
ppcState.fpscr = 0;
ppcState.pc = 0;
ppcState.npc = 0;
diff --git a/Source/Core/Core/PowerPC/PowerPC.h b/Source/Core/Core/PowerPC/PowerPC.h
index 12295cf2cb..04e41fb339 100644
--- a/Source/Core/Core/PowerPC/PowerPC.h
+++ b/Source/Core/Core/PowerPC/PowerPC.h
@@ -39,7 +39,6 @@ struct GC_ALIGNED64(PowerPCState)
u32 pc; // program counter
u32 npc;
- u32 cr; // flags
u8 cr_fast[8]; // Possibly reorder to 0, 2, 4, 8, 1, 3, 5, 7 so that we can make Compact and Expand super fast?
u32 msr; // machine specific register
@@ -101,8 +100,8 @@ void Stop();
CPUState GetState();
volatile CPUState *GetStatePtr(); // this oddity is here instead of an extern declaration to easily be able to find all direct accesses throughout the code.
-void CompactCR();
-void ExpandCR();
+u32 CompactCR();
+void ExpandCR(u32 cr);
void OnIdle(u32 _uThreadAddr);
void OnIdleIL();
@@ -171,13 +170,11 @@ inline void SetCRBit(int bit, int value) {
// SetCR and GetCR are fairly slow. Should be avoided if possible.
inline void SetCR(u32 new_cr) {
- PowerPC::ppcState.cr = new_cr;
- PowerPC::ExpandCR();
+ PowerPC::ExpandCR(new_cr);
}
inline u32 GetCR() {
- PowerPC::CompactCR();
- return PowerPC::ppcState.cr;
+ return PowerPC::CompactCR();
}
// SetCarry/GetCarry may speed up soon.