From 537801e466ca1c014b3709666ad8aef73a1e8560 Mon Sep 17 00:00:00 2001 From: arcum42 Date: Thu, 22 Oct 2009 01:35:58 +0000 Subject: [PATCH] Just cleaning up the changes in r2056 a bit. git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2057 96395faa-99c1-11dd-bbfe-3dabce05a288 --- common/src/x86emitter/tools.cpp | 55 +++++++++------------------------ 1 file changed, 15 insertions(+), 40 deletions(-) diff --git a/common/src/x86emitter/tools.cpp b/common/src/x86emitter/tools.cpp index f3b6e9b61..9bedf8e55 100644 --- a/common/src/x86emitter/tools.cpp +++ b/common/src/x86emitter/tools.cpp @@ -29,31 +29,21 @@ __aligned16 u64 g_globalXMMData[2*iREGCNT_XMM]; namespace MMXRegisters { - u8 g_globalMMXSaved = 0; - - __forceinline u8 Depth() - { - return g_globalMMXSaved; - } + u8 stack_depth = 0; __forceinline bool Saved() { - return ( Depth() > 0); - } - - __forceinline bool SavedRepeatedly() - { - return ( Depth() > 1); + return ( stack_depth > 0); } __forceinline void Freeze() { if (!g_EEFreezeRegs) return; - //DevCon.Notice("FreezeMMXRegs_(%d); [%d]\n", save, g_globalMMXSaved); - g_globalMMXSaved++; + //DevCon.Notice("MMXRegisters::Freeze: depth[%d]\n", stack_depth); + stack_depth++; - if (SavedRepeatedly()) + if (stack_depth > 1) { //DevCon.Notice("MMX Already Saved!\n"); return; @@ -93,14 +83,14 @@ namespace MMXRegisters { if (!g_EEFreezeRegs) return; - //DevCon.Notice("FreezeMMXRegs_(%d); [%d]\n", save, g_globalMMXSaved); + //DevCon.Notice("MMXRegisters::Thaw: depth[%d]\n", stack_depth); if (!Saved()) { //DevCon.Notice("MMX Not Saved!\n"); return; } - g_globalMMXSaved--; + stack_depth--; if (Saved()) return; @@ -141,32 +131,22 @@ namespace MMXRegisters namespace XMMRegisters { - u8 g_globalXMMSaved = 0; - - __forceinline u8 Depth() - { - return g_globalXMMSaved; - } + u8 stack_depth = 0; __forceinline bool Saved() { - return ( Depth() > 0); - } - - __forceinline bool SavedRepeatedly() - { - return ( Depth() > 1); + return ( stack_depth > 0); } __forceinline void Freeze() { if (!g_EEFreezeRegs) return; - //DevCon.Notice("FreezeXMMRegs_(%d); [%d]\n", save, g_globalXMMSaved); + //DevCon.Notice("XMMRegisters::Freeze: depth[%d]\n", Depth()); - g_globalXMMSaved++; + stack_depth++; - if (SavedRepeatedly()) + if (stack_depth > 1) { //DevCon.Notice("XMM Already saved\n"); return; @@ -204,16 +184,16 @@ namespace XMMRegisters { if (!g_EEFreezeRegs) return; - //DevCon.Notice("FreezeXMMRegs_(%d); [%d]\n", save, g_globalXMMSaved); + //DevCon.Notice("XMMRegisters::Thaw: depth[%d]\n", Depth()); - if (!Saved()) + if (!Saved()) { //DevCon.Notice("XMM Regs not saved!\n"); return; } // TODO: really need to backup all regs? - g_globalXMMSaved--; + stack_depth--; if (Saved()) return; #ifdef _MSC_VER @@ -257,11 +237,6 @@ namespace Registers return (XMMRegisters::Saved() || MMXRegisters::Saved()); } - __forceinline bool SavedRepeatedly() - { - return (XMMRegisters::SavedRepeatedly() || MMXRegisters::SavedRepeatedly()); - } - __forceinline void Freeze() { XMMRegisters::Freeze();