diff --git a/src/scripting/vm/jit_load.cpp b/src/scripting/vm/jit_load.cpp index e8864af5c..5f0b8d52f 100644 --- a/src/scripting/vm/jit_load.cpp +++ b/src/scripting/vm/jit_load.cpp @@ -172,13 +172,15 @@ void JitCompiler::EmitLHU_R() void JitCompiler::EmitLSP() { EmitNullPointerThrow(B, X_READ_NIL); - cc.movss(regF[A], asmjit::x86::dword_ptr(regA[B], konstd[C])); + cc.xorpd(regF[A], regF[A]); + cc.cvtss2sd(regF[A], asmjit::x86::dword_ptr(regA[B], konstd[C])); } void JitCompiler::EmitLSP_R() { EmitNullPointerThrow(B, X_READ_NIL); - cc.movss(regF[A], asmjit::x86::dword_ptr(regA[B], regD[C])); + cc.xorpd(regF[A], regF[A]); + cc.cvtss2sd(regF[A], asmjit::x86::dword_ptr(regA[B], regD[C])); } void JitCompiler::EmitLDP() diff --git a/src/scripting/vm/jit_store.cpp b/src/scripting/vm/jit_store.cpp index 3ae500a1a..c1d739f0f 100644 --- a/src/scripting/vm/jit_store.cpp +++ b/src/scripting/vm/jit_store.cpp @@ -40,13 +40,19 @@ void JitCompiler::EmitSW_R() void JitCompiler::EmitSSP() { EmitNullPointerThrow(A, X_WRITE_NIL); - cc.movss(asmjit::x86::dword_ptr(regA[A], konstd[C]), regF[B]); + auto tmp = newTempXmmSd(); + cc.xorpd(tmp, tmp); + cc.cvtsd2ss(tmp, regF[B]); + cc.movss(asmjit::x86::dword_ptr(regA[A], konstd[C]), tmp); } void JitCompiler::EmitSSP_R() { EmitNullPointerThrow(A, X_WRITE_NIL); - cc.movss(asmjit::x86::dword_ptr(regA[A], regD[C]), regF[B]); + auto tmp = newTempXmmSd(); + cc.xorpd(tmp, tmp); + cc.cvtsd2ss(tmp, regF[B]); + cc.movss(asmjit::x86::dword_ptr(regA[A], regD[C]), tmp); } void JitCompiler::EmitSDP()