From d41acebb3de06710fd71a757f598e7c95037166c Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 3 Nov 2013 00:09:39 -0700 Subject: [PATCH 1/2] Fix Comp_VRot on x86 Linux/Mac/etc. Easy way: just use our existing functions that work. --- Core/MIPS/x86/CompVFPU.cpp | 38 ++++++++++++++++++++++++-------------- 1 file changed, 24 insertions(+), 14 deletions(-) diff --git a/Core/MIPS/x86/CompVFPU.cpp b/Core/MIPS/x86/CompVFPU.cpp index 71753d8bf8..ee7087883f 100644 --- a/Core/MIPS/x86/CompVFPU.cpp +++ b/Core/MIPS/x86/CompVFPU.cpp @@ -1926,13 +1926,33 @@ void Jit::Comp_Vfim(MIPSOpcode op) { static float sincostemp[2]; -void SinCos(float angle) { +union u32float { + u32 u; + float f; + + operator float() const { + return f; + } + + inline u32float &operator *=(const float &other) { + f *= other; + return *this; + } +}; + +#ifdef _M_X64 +typedef float SinCosArg; +#else +typedef u32float SinCosArg; +#endif + +void SinCos(SinCosArg angle) { angle *= (float)1.57079632679489661923; // pi / 2 sincostemp[0] = sinf(angle); sincostemp[1] = cosf(angle); } -void SinCosNegSin(float angle) { +void SinCosNegSin(SinCosArg angle) { angle *= (float)1.57079632679489661923; // pi / 2 sincostemp[0] = -sinf(angle); sincostemp[1] = cosf(angle); @@ -1940,14 +1960,8 @@ void SinCosNegSin(float angle) { // Very heavily used by FF:CC void Jit::Comp_VRot(MIPSOpcode op) { - // DISABLE; CONDITIONAL_DISABLE; - // Keeping it enabled in x64 non-windows as it seems fine there. -#if defined(_M_IX86) && !defined(_WIN32) - DISABLE; -#endif - int vd = _VD; int vs = _VS; @@ -1970,12 +1984,8 @@ void Jit::Comp_VRot(MIPSOpcode op) { MOVSS(XMM0, fpr.V(sreg)); ABI_CallFunction(negSin ? (void *)&SinCosNegSin : (void *)&SinCos); #else - // Sigh, passing floats with cdecl isn't pretty. - MOVSS(XMM0, fpr.V(sreg)); - SUB(32, R(ESP), Imm32(4)); - MOVSS(MatR(ESP), XMM0); - ABI_CallFunction(negSin ? (void *)&SinCosNegSin : (void *)&SinCos); - ADD(32, R(ESP), Imm32(4)); + // Sigh, passing floats with cdecl isn't pretty, ends up on the stack. + ABI_CallFunction(negSin ? (void *)&SinCosNegSin : (void *)&SinCos, fpr.V(sreg)); #endif MOVSS(XMM0, M(&sincostemp[0])); From 587ba7cd5f448337cda468fbeeb3f9fcaec80057 Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Sun, 3 Nov 2013 00:13:33 -0700 Subject: [PATCH 2/2] Allow test.py to run from within a build/ dir. --- test.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/test.py b/test.py index 9ef9c7fd41..d2b11c3c04 100755 --- a/test.py +++ b/test.py @@ -282,10 +282,13 @@ tests_ignored = [ def init(): - global PPSSPP_EXE + global PPSSPP_EXE, TEST_ROOT if not os.path.exists("pspautotests"): - print("Please run git submodule init; git submodule update;") - sys.exit(1) + if os.path.exists(os.path.dirname(__file__) + "/pspautotests"): + TEST_ROOT = os.path.dirname(__file__) + "/pspautotests/tests/"; + else: + print("Please run git submodule init; git submodule update;") + sys.exit(1) if not os.path.exists(TEST_ROOT + "cpu/cpu_alu/cpu_alu.prx"): print("Please install the pspsdk and run make in common/ and in all the tests")