- fix 32 bit compile errors

This commit is contained in:
Magnus Norddahl 2018-10-07 20:55:06 +02:00
parent f321f64a05
commit 47bcf318a5
3 changed files with 29 additions and 34 deletions

View file

@ -272,11 +272,10 @@ void JitCompiler::EmitThrowException(EVMAbortException reason)
// Update JitExceptionInfo struct // Update JitExceptionInfo struct
cc.mov(x86::dword_ptr(exceptInfo, 0 * 4), (int32_t)reason); cc.mov(x86::dword_ptr(exceptInfo, 0 * 4), (int32_t)reason);
#ifdef ASMJIT_ARCH_64BIT if (cc.is64Bit())
cc.mov(x86::qword_ptr(exceptInfo, 4 * 4), imm_ptr(pc)); cc.mov(x86::qword_ptr(exceptInfo, 4 * 4), imm_ptr(pc));
#else else
cc.mov(x86::dword_ptr(exceptInfo, 4 * 4), imm_ptr(pc)); cc.mov(x86::dword_ptr(exceptInfo, 4 * 4), imm_ptr(pc));
#endif
// Return from function // Return from function
X86Gp vReg = newTempInt32(); X86Gp vReg = newTempInt32();
@ -291,11 +290,10 @@ void JitCompiler::EmitThrowException(EVMAbortException reason, asmjit::X86Gp arg
// Update JitExceptionInfo struct // Update JitExceptionInfo struct
cc.mov(x86::dword_ptr(exceptInfo, 0 * 4), (int32_t)reason); cc.mov(x86::dword_ptr(exceptInfo, 0 * 4), (int32_t)reason);
cc.mov(x86::dword_ptr(exceptInfo, 1 * 4), arg1); cc.mov(x86::dword_ptr(exceptInfo, 1 * 4), arg1);
#ifdef ASMJIT_ARCH_64BIT if (cc.is64Bit())
cc.mov(x86::qword_ptr(exceptInfo, 4 * 4), imm_ptr(pc)); cc.mov(x86::qword_ptr(exceptInfo, 4 * 4), imm_ptr(pc));
#else else
cc.mov(x86::dword_ptr(exceptInfo, 4 * 4), imm_ptr(pc)); cc.mov(x86::dword_ptr(exceptInfo, 4 * 4), imm_ptr(pc));
#endif
// Return from function // Return from function
X86Gp vReg = newTempInt32(); X86Gp vReg = newTempInt32();

View file

@ -195,17 +195,20 @@ void JitCompiler::EmitRET()
break; break;
} }
case REGT_POINTER: case REGT_POINTER:
#ifdef ASMJIT_ARCH_64BIT if (cc.is64Bit())
{
if (regtype & REGT_KONST) if (regtype & REGT_KONST)
cc.mov(x86::qword_ptr(location), asmjit::imm_ptr(konsta[regnum].v)); cc.mov(x86::qword_ptr(location), asmjit::imm_ptr(konsta[regnum].v));
else else
cc.mov(x86::qword_ptr(location), regA[regnum]); cc.mov(x86::qword_ptr(location), regA[regnum]);
#else }
else
{
if (regtype & REGT_KONST) if (regtype & REGT_KONST)
cc.mov(x86::dword_ptr(location), asmjit::imm_ptr(konsta[regnum].v)); cc.mov(x86::dword_ptr(location), asmjit::imm_ptr(konsta[regnum].v));
else else
cc.mov(x86::dword_ptr(location), regA[regnum]); cc.mov(x86::dword_ptr(location), regA[regnum]);
#endif }
break; break;
} }

View file

@ -52,13 +52,10 @@ void JitCompiler::EmitLKS_R()
auto base = newTempIntPtr(); auto base = newTempIntPtr();
cc.mov(base, asmjit::imm_ptr(konsts + C)); cc.mov(base, asmjit::imm_ptr(konsts + C));
auto ptr = newTempIntPtr(); auto ptr = newTempIntPtr();
#ifdef ASMJIT_ARCH_64BIT if (cc.is64Bit())
static_assert(sizeof(FString) == 8, "sizeof(FString) needs to be 8");
cc.lea(ptr, asmjit::x86::ptr(base, regD[B], 3)); cc.lea(ptr, asmjit::x86::ptr(base, regD[B], 3));
#else else
static_assert(sizeof(FString) == 4, "sizeof(FString) needs to be 4");
cc.lea(ptr, asmjit::x86::ptr(base, regD[B], 2)); cc.lea(ptr, asmjit::x86::ptr(base, regD[B], 2));
#endif
auto call = CreateCall<void, FString*, FString*>(&JitCompiler::CallAssignString); auto call = CreateCall<void, FString*, FString*>(&JitCompiler::CallAssignString);
call->setArg(0, regS[A]); call->setArg(0, regS[A]);
call->setArg(1, ptr); call->setArg(1, ptr);
@ -68,13 +65,10 @@ void JitCompiler::EmitLKP_R()
{ {
auto base = newTempIntPtr(); auto base = newTempIntPtr();
cc.mov(base, asmjit::imm_ptr(konsta + C)); cc.mov(base, asmjit::imm_ptr(konsta + C));
#ifdef ASMJIT_ARCH_64BIT if (cc.is64Bit())
static_assert(sizeof(FVoidObj) == 8, "sizeof(FVoidObj) needs to be 8");
cc.mov(regA[A], asmjit::x86::ptr(base, regD[B], 3)); cc.mov(regA[A], asmjit::x86::ptr(base, regD[B], 3));
#else else
static_assert(sizeof(FVoidObj) == 4, "sizeof(FVoidObj) needs to be 4");
cc.mov(regA[A], asmjit::x86::ptr(base, regD[B], 2)); cc.mov(regA[A], asmjit::x86::ptr(base, regD[B], 2));
#endif
} }
void JitCompiler::EmitLFP() void JitCompiler::EmitLFP()