From 519f9f429832c52a35c7589d524242f46fd91cdd Mon Sep 17 00:00:00 2001 From: RaveYard Date: Fri, 10 Jun 2022 11:59:06 +0200 Subject: [PATCH] Fix JIT pointer offsets --- src/common/scripting/jit/jit_load.cpp | 10 +++++----- src/common/scripting/jit/jit_store.cpp | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/common/scripting/jit/jit_load.cpp b/src/common/scripting/jit/jit_load.cpp index 64231abf70..ec5f795df8 100644 --- a/src/common/scripting/jit/jit_load.cpp +++ b/src/common/scripting/jit/jit_load.cpp @@ -342,7 +342,7 @@ void JitCompiler::EmitLFV2_R() auto tmp = newTempIntPtr(); cc.lea(tmp, asmjit::x86::qword_ptr(regA[B], regD[C])); cc.movss(regF[A], asmjit::x86::qword_ptr(tmp)); - cc.movss(regF[A + 1], asmjit::x86::qword_ptr(tmp, 8)); + cc.movss(regF[A + 1], asmjit::x86::qword_ptr(tmp, 4)); cc.cvtss2sd(regF[A], regF[A]); cc.cvtss2sd(regF[A + 1], regF[A + 1]); } @@ -353,8 +353,8 @@ void JitCompiler::EmitLFV3() auto tmp = newTempIntPtr(); cc.lea(tmp, asmjit::x86::qword_ptr(regA[B], konstd[C])); cc.movss(regF[A], asmjit::x86::qword_ptr(tmp)); - cc.movss(regF[A + 1], asmjit::x86::qword_ptr(tmp, 8)); - cc.movss(regF[A + 2], asmjit::x86::qword_ptr(tmp, 16)); + cc.movss(regF[A + 1], asmjit::x86::qword_ptr(tmp, 4)); + cc.movss(regF[A + 2], asmjit::x86::qword_ptr(tmp, 8)); cc.cvtss2sd(regF[A], regF[A]); cc.cvtss2sd(regF[A + 1], regF[A + 1]); cc.cvtss2sd(regF[A + 2], regF[A + 2]); @@ -366,8 +366,8 @@ void JitCompiler::EmitLFV3_R() auto tmp = newTempIntPtr(); cc.lea(tmp, asmjit::x86::qword_ptr(regA[B], regD[C])); cc.movss(regF[A], asmjit::x86::qword_ptr(tmp)); - cc.movss(regF[A + 1], asmjit::x86::qword_ptr(tmp, 8)); - cc.movss(regF[A + 2], asmjit::x86::qword_ptr(tmp, 16)); + cc.movss(regF[A + 1], asmjit::x86::qword_ptr(tmp, 4)); + cc.movss(regF[A + 2], asmjit::x86::qword_ptr(tmp, 8)); cc.cvtss2sd(regF[A], regF[A]); cc.cvtss2sd(regF[A + 1], regF[A + 1]); cc.cvtss2sd(regF[A + 2], regF[A + 2]); diff --git a/src/common/scripting/jit/jit_store.cpp b/src/common/scripting/jit/jit_store.cpp index dc98374d1a..2bce225664 100644 --- a/src/common/scripting/jit/jit_store.cpp +++ b/src/common/scripting/jit/jit_store.cpp @@ -201,7 +201,7 @@ void JitCompiler::EmitSFV3() cc.cvtsd2ss(tmpF, regF[B + 1]); cc.movss(asmjit::x86::qword_ptr(tmp, 4), tmpF); cc.cvtsd2ss(tmpF, regF[B + 2]); - cc.movss(asmjit::x86::qword_ptr(tmp, 4), tmpF); + cc.movss(asmjit::x86::qword_ptr(tmp, 8), tmpF); } void JitCompiler::EmitSFV3_R() @@ -216,7 +216,7 @@ void JitCompiler::EmitSFV3_R() cc.cvtsd2ss(tmpF, regF[B + 1]); cc.movss(asmjit::x86::qword_ptr(tmp, 4), tmpF); cc.cvtsd2ss(tmpF, regF[B + 2]); - cc.movss(asmjit::x86::qword_ptr(tmp, 4), tmpF); + cc.movss(asmjit::x86::qword_ptr(tmp, 8), tmpF); } void JitCompiler::EmitSBIT()