diff options
| author | degasus <wickmarkus@web.de> | 2014-06-02 14:21:40 +0200 |
|---|---|---|
| committer | degasus <wickmarkus@web.de> | 2014-06-02 18:12:53 +0200 |
| commit | 0cd9eea99ec677ab4860c4cefbb96f8ca4c9fd58 (patch) | |
| tree | ab31d2ea06d7bf516ec79d108ceb36a676389b3a /Source/Core | |
| parent | 38c3812a60c44f492c5cb5844dd5ca5a9a40d3fc (diff) | |
RegCache: make state clear optional on flushes
Diffstat (limited to 'Source/Core')
| -rw-r--r-- | Source/Core/Core/PowerPC/Jit64/JitRegCache.cpp | 30 | ||||
| -rw-r--r-- | Source/Core/Core/PowerPC/Jit64/JitRegCache.h | 6 |
2 files changed, 18 insertions, 18 deletions
diff --git a/Source/Core/Core/PowerPC/Jit64/JitRegCache.cpp b/Source/Core/Core/PowerPC/Jit64/JitRegCache.cpp index 97865a7b3f..40693326c7 100644 --- a/Source/Core/Core/PowerPC/Jit64/JitRegCache.cpp +++ b/Source/Core/Core/PowerPC/Jit64/JitRegCache.cpp @@ -255,7 +255,7 @@ void RegCache::BindToRegister(int i, bool doLoad, bool makeDirty) } } -void RegCache::StoreFromRegister(int i) +void RegCache::StoreFromRegister(int i, bool clearState) { if (regs[i].away) { @@ -263,10 +263,13 @@ void RegCache::StoreFromRegister(int i) if (regs[i].location.IsSimpleReg()) { X64Reg xr = RX(i); - xregs[xr].free = true; - xregs[xr].ppcReg = -1; doStore = xregs[xr].dirty; - xregs[xr].dirty = false; + if(clearState) + { + xregs[xr].free = true; + xregs[xr].ppcReg = -1; + xregs[xr].dirty = false; + } } else { @@ -276,8 +279,11 @@ void RegCache::StoreFromRegister(int i) OpArg newLoc = GetDefaultLocation(i); if (doStore) StoreRegister(i, newLoc); - regs[i].location = newLoc; - regs[i].away = false; + if(clearState) + { + regs[i].location = newLoc; + regs[i].away = false; + } } } @@ -305,7 +311,7 @@ void FPURegCache::StoreRegister(int preg, OpArg newLoc) emit->MOVAPD(newLoc, regs[preg].location.GetSimpleReg()); } -void RegCache::Flush() +void RegCache::Flush(bool clearState) { for (int i = 0; i < (int)xregs.size(); i++) { @@ -321,15 +327,9 @@ void RegCache::Flush() } if (regs[i].away) { - if (regs[i].location.IsSimpleReg()) - { - X64Reg xr = RX(i); - StoreFromRegister(i); - xregs[xr].dirty = false; - } - else if (regs[i].location.IsImm()) + if (regs[i].location.IsSimpleReg() || regs[i].location.IsImm()) { - StoreFromRegister(i); + StoreFromRegister(i, clearState); } else { diff --git a/Source/Core/Core/PowerPC/Jit64/JitRegCache.h b/Source/Core/Core/PowerPC/Jit64/JitRegCache.h index 45a8b623cc..97f2f57d49 100644 --- a/Source/Core/Core/PowerPC/Jit64/JitRegCache.h +++ b/Source/Core/Core/PowerPC/Jit64/JitRegCache.h @@ -63,15 +63,15 @@ public: FlushR(reg1); FlushR(reg2); LockX(reg1); LockX(reg2); } - virtual void Flush(); - virtual void Flush(PPCAnalyst::CodeOp *op) {Flush();} + void Flush(bool clearState = true); + void Flush(PPCAnalyst::CodeOp *op) {Flush();} int SanityCheck() const; void KillImmediate(int preg, bool doLoad, bool makeDirty); //TODO - instead of doload, use "read", "write" //read only will not set dirty flag void BindToRegister(int preg, bool doLoad = true, bool makeDirty = true); - void StoreFromRegister(int preg); + void StoreFromRegister(int preg, bool clearState = true); virtual void StoreRegister(int preg, OpArg newLoc) = 0; virtual void LoadRegister(int preg, X64Reg newLoc) = 0; |
