diff --git a/src/scripting/vm/jit_load.cpp b/src/scripting/vm/jit_load.cpp index 5fdbdbaf1..1f7589271 100644 --- a/src/scripting/vm/jit_load.cpp +++ b/src/scripting/vm/jit_load.cpp @@ -16,9 +16,9 @@ void JitCompiler::EmitLK() void JitCompiler::EmitLKF() { - auto tmp = cc.newIntPtr(); - cc.mov(tmp, ToMemAddress(konstf + BC)); - cc.movsd(regF[A], asmjit::x86::qword_ptr(tmp)); + auto base = cc.newIntPtr(); + cc.mov(base, ToMemAddress(konstf + BC)); + cc.movsd(regF[A], asmjit::x86::qword_ptr(base)); } void JitCompiler::EmitLKS() @@ -36,14 +36,16 @@ void JitCompiler::EmitLKP() void JitCompiler::EmitLK_R() { - cc.mov(regD[A], asmjit::x86::ptr(ToMemAddress(konstd + C), regD[B], 2)); + auto base = cc.newIntPtr(); + cc.mov(base, ToMemAddress(konstd + C)); + cc.mov(regD[A], asmjit::x86::ptr(base, regD[B], 2)); } void JitCompiler::EmitLKF_R() { - auto tmp = cc.newIntPtr(); - cc.mov(tmp, ToMemAddress(konstf + C)); - cc.movsd(regF[A], asmjit::x86::qword_ptr(tmp, regD[B], 3)); + auto base = cc.newIntPtr(); + cc.mov(base, ToMemAddress(konstf + C)); + cc.movsd(regF[A], asmjit::x86::qword_ptr(base, regD[B], 3)); } void JitCompiler::EmitLKS_R() @@ -68,7 +70,9 @@ void JitCompiler::EmitLKS_R() void JitCompiler::EmitLKP_R() { - cc.mov(regA[A], asmjit::x86::ptr(ToMemAddress(konsta + C), regD[B], 2)); + auto base = cc.newIntPtr(); + cc.mov(base, ToMemAddress(konsta + C)); + cc.mov(regA[A], asmjit::x86::ptr(base, regD[B], 2)); } void JitCompiler::EmitLFP() diff --git a/src/scripting/vm/jitintern.h b/src/scripting/vm/jitintern.h index be8abec7f..e19b5c6c2 100644 --- a/src/scripting/vm/jitintern.h +++ b/src/scripting/vm/jitintern.h @@ -65,9 +65,9 @@ private: pc++; // This instruction uses two instruction slots - skip the next one } - static int64_t ToMemAddress(const void *d) + static uint64_t ToMemAddress(const void *d) { - return (int64_t)(ptrdiff_t)d; + return (uint64_t)(ptrdiff_t)d; } void CallSqrt(const asmjit::X86Xmm &a, const asmjit::X86Xmm &b);