From 4e9be9aa594207c4a0fc229157af5e031a2cb87b Mon Sep 17 00:00:00 2001 From: Sonicadvance1 Date: Wed, 17 Mar 2010 09:38:13 +0000 Subject: [PATCH] This fixes JIT Loading Store Floating in 64bit OSX git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@5205 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/CoreParameter.cpp | 1 + .../Src/PowerPC/JitCommon/JitAsmCommon.cpp | 35 ++++++++++++++++++- 2 files changed, 35 insertions(+), 1 deletion(-) diff --git a/Source/Core/Core/Src/CoreParameter.cpp b/Source/Core/Core/Src/CoreParameter.cpp index eae09c1124..21179d769e 100644 --- a/Source/Core/Core/Src/CoreParameter.cpp +++ b/Source/Core/Core/Src/CoreParameter.cpp @@ -93,6 +93,7 @@ void SCoreStartupParameter::LoadDefaults() // Since all 64bit applications are above the 32bit memory boundary bJITLoadStoreOff = true; bJITLoadStorePairedOff = true; + //bJITLoadStoreFloatingOff = true; #endif //#elif defined(__linux__) // Similar to OSX, something with LoadStorePaired seems to cause diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.cpp index 3d34917bdd..667c91bd69 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.cpp @@ -37,6 +37,39 @@ using namespace Gen; static int temp32; + +#ifdef __APPLE__ && _M_X64 +void CommonAsmRoutines::GenFifoFloatWrite() +{ + // Assume value in XMM0 + PUSH(RSI); + PUSH(EDX); + MOVSS(M(&temp32), XMM0); + MOV(32, R(EDX), M(&temp32)); + BSWAP(32, EDX); + MOV(64, R(RAX), Imm64((u64)GPFifo::m_gatherPipe)); + MOV(64, R(RSI), M(&GPFifo::m_gatherPipeCount)); + MOV(32, MComplex(RAX, RSI, 1, 0), R(EDX)); + ADD(64, R(RSI), Imm8(4)); + MOV(64, M(&GPFifo::m_gatherPipeCount), R(RSI)); + POP(EDX); + POP(RSI); + RET(); +} + +void CommonAsmRoutines::GenFifoXmm64Write() +{ + // Assume value in XMM0. Assume pre-byteswapped (unlike the others here!) + PUSH(RSI); + MOV(64, R(RAX), Imm32((u64)GPFifo::m_gatherPipe)); + MOV(64, R(RSI), M(&GPFifo::m_gatherPipeCount)); + MOVQ_xmm(MComplex(RAX, RSI, 1, 0), XMM0); + ADD(64, R(RSI), Imm8(8)); + MOV(64, M(&GPFifo::m_gatherPipeCount), R(RSI)); + POP(RSI); + RET(); +} +#else void CommonAsmRoutines::GenFifoWrite(int size) { // Assume value in ABI_PARAM1 @@ -77,7 +110,7 @@ void CommonAsmRoutines::GenFifoFloatWrite() POP(ESI); RET(); } - +#endif void CommonAsmRoutines::GenFifoXmm64Write() { // Assume value in XMM0. Assume pre-byteswapped (unlike the others here!)