From 4e4a613b8bdfbf6980d45fa56fab5d5836f72a3b Mon Sep 17 00:00:00 2001 From: pierre Date: Sat, 16 Apr 2011 14:08:36 +0000 Subject: [PATCH] Core/PowerPC/JitCommon: Put the quantized paired/single load/store tables into the code memory. This makes sure they are below 2G on 64bit systems, allowing us to continue using the simpler 32bit accesses. Fixes issue 4357 and issue 4397. git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7465 8ced0084-cf51-0410-be5f-012b33b47a6e --- Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.cpp | 9 +++++++++ Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.h | 6 +++--- 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.cpp b/Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.cpp index 6a572d2daf..6ee8d2335c 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.cpp +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.cpp @@ -287,6 +287,9 @@ void CommonAsmRoutines::GenQuantizedStores() { RET(); + pairedStoreQuantized = reinterpret_cast(const_cast(AlignCode16())); + ReserveCodeSpace(8 * sizeof(u8*)); + pairedStoreQuantized[0] = storePairedFloat; pairedStoreQuantized[1] = storePairedIllegal; pairedStoreQuantized[2] = storePairedIllegal; @@ -361,6 +364,9 @@ void CommonAsmRoutines::GenQuantizedSingleStores() { SafeWriteRegToReg(EAX, ECX, 16, 0, true); RET(); + singleStoreQuantized = reinterpret_cast(const_cast(AlignCode16())); + ReserveCodeSpace(8 * sizeof(u8*)); + singleStoreQuantized[0] = storeSingleFloat; singleStoreQuantized[1] = storeSingleIllegal; singleStoreQuantized[2] = storeSingleIllegal; @@ -538,6 +544,9 @@ void CommonAsmRoutines::GenQuantizedLoads() { UNPCKLPS(XMM0, M((void*)m_one)); RET(); + pairedLoadQuantized = reinterpret_cast(const_cast(AlignCode16())); + ReserveCodeSpace(16 * sizeof(u8*)); + pairedLoadQuantized[0] = loadPairedFloatTwo; pairedLoadQuantized[1] = loadPairedIllegal; pairedLoadQuantized[2] = loadPairedIllegal; diff --git a/Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.h b/Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.h index ce298f7661..7385949ac0 100644 --- a/Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.h +++ b/Source/Core/Core/Src/PowerPC/JitCommon/JitAsmCommon.h @@ -56,19 +56,19 @@ public: // Out: XMM0: Bottom two 32-bit slots hold the read value, // converted to a pair of floats. // Trashes: EAX ECX EDX - const u8 GC_ALIGNED16(*pairedLoadQuantized[16]); + const u8 **pairedLoadQuantized; // In: array index: GQR to use. // In: ECX: Address to write to. // In: XMM0: Bottom two 32-bit slots hold the pair of floats to be written. // Out: Nothing. // Trashes: EAX ECX EDX - const u8 GC_ALIGNED16(*pairedStoreQuantized[8]); + const u8 **pairedStoreQuantized; // In: array index: GQR to use. // In: ECX: Address to write to. // In: XMM0: Bottom 32-bit slot holds the float to be written. - const u8 GC_ALIGNED16(*singleStoreQuantized[8]); + const u8 **singleStoreQuantized; private: ThunkManager thunks;