From b6a75bf255a79d5fca2f4f642cf7d115b37b51bb Mon Sep 17 00:00:00 2001 From: "Unknown W. Brackets" Date: Wed, 17 Dec 2014 01:00:21 -0800 Subject: [PATCH] x86jit: Set CTXREG in a fixed place. --- Core/MIPS/x86/Asm.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/Core/MIPS/x86/Asm.cpp b/Core/MIPS/x86/Asm.cpp index a29a5c536d..2ea9269a87 100644 --- a/Core/MIPS/x86/Asm.cpp +++ b/Core/MIPS/x86/Asm.cpp @@ -71,6 +71,8 @@ void AsmRoutineManager::Generate(MIPSState *mips, MIPSComp::Jit *jit) MOV(64, R(RBX), ImmPtr(Memory::base)); MOV(64, R(R15), ImmPtr(jit->GetBasePtr())); //It's below 2GB so 32 bits are good enough #endif + // From the start of the FP reg, a single byte offset can reach all GPR + all FPR (but no VFPUR) + MOV(PTRBITS, R(CTXREG), ImmPtr(&mips->f[0])); outerLoop = GetCodePtr(); jit->RestoreRoundingMode(true, this); @@ -99,11 +101,8 @@ void AsmRoutineManager::Generate(MIPSState *mips, MIPSComp::Jit *jit) dispatcherNoCheck = GetCodePtr(); - // TODO: Find a less costly place to put this (or multiple..)? - // From the start of the FP reg, a single byte offset can reach all GPR + all FPR (but no VFPUR) - MOV(PTRBITS, R(CTXREG), ImmPtr(&mips->f[0])); - MOV(32, R(EAX), M(&mips->pc)); + #ifdef _M_IX86 AND(32, R(EAX), Imm32(Memory::MEMVIEW32_MASK)); _assert_msg_(CPU, Memory::base != 0, "Memory base bogus");