diff --git a/Core/CoreTiming.cpp b/Core/CoreTiming.cpp index a080adb17..1879a4869 100644 --- a/Core/CoreTiming.cpp +++ b/Core/CoreTiming.cpp @@ -74,7 +74,7 @@ volatile u32 hasTsEvents = false; // as we can already reach that structure through a register. int slicelength; -s64 globalTimer; +MEMORY_ALIGNED16(s64) globalTimer; s64 idledCycles; static std::recursive_mutex externalEventSection; diff --git a/GPU/GPUCommon.h b/GPU/GPUCommon.h index 86f3a0b2b..bec360576 100644 --- a/GPU/GPUCommon.h +++ b/GPU/GPUCommon.h @@ -1,8 +1,14 @@ #pragma once +#include "Common/Common.h" #include "Core/ThreadEventQueue.h" #include "GPU/GPUInterface.h" +#ifdef _M_SSE +#include +#pragma warning(disable:4799) +#endif + typedef ThreadEventQueue GPUThreadEventQueue; class GPUCommon : public GPUThreadEventQueue @@ -37,10 +43,15 @@ public: virtual void ReapplyGfxState(); virtual u64 GetTickEstimate() { -#ifndef _M_X64 - lock_guard guard(curTickEstLock_); -#endif +#if defined(_M_X64) return curTickEst_; +#elif defined(_M_SSE) + __m64 result = *(__m64 *)&curTickEst_; + return *(u64 *)&result; +#else + lock_guard guard(curTickEstLock_); + return curTickEst_; +#endif } protected: @@ -94,14 +105,19 @@ protected: bool interruptsEnabled_; // For CPU/GPU sync. - volatile u64 curTickEst_; + volatile MEMORY_ALIGNED16(u64) curTickEst_; recursive_mutex curTickEstLock_; virtual void UpdateTickEstimate(u64 value) { -#ifndef _M_X64 - lock_guard guard(curTickEstLock_); -#endif +#if defined(_M_X64) curTickEst_ = value; +#elif defined(_M_SSE) + __m64 result = *(__m64 *)&value; + *(__m64 *)&curTickEst_ = result; +#else + lock_guard guard(curTickEstLock_); + curTickEst_ = value; +#endif } public: