Merge remote-tracking branch 'remotes/origin/master' into Texture_Cleanup

# Conflicts:
#	src/polyrenderer/poly_renderthread.cpp
#	src/swrenderer/r_renderthread.cpp
This commit is contained in:
Christoph Oelckers 2018-12-10 18:47:21 +01:00
commit 91a8f5cd04
17 changed files with 126 additions and 59 deletions

View file

@ -543,6 +543,8 @@ void JitCompiler::EmitNativeCall(VMNativeFunction *target)
ParamOpcodes.Clear();
}
static std::map<FString, std::unique_ptr<TArray<uint8_t>>> argsCache;
asmjit::FuncSignature JitCompiler::CreateFuncSignature()
{
using namespace asmjit;
@ -657,7 +659,6 @@ asmjit::FuncSignature JitCompiler::CreateFuncSignature()
}
// FuncSignature only keeps a pointer to its args array. Store a copy of each args array variant.
static std::map<FString, std::unique_ptr<TArray<uint8_t>>> argsCache;
std::unique_ptr<TArray<uint8_t>> &cachedArgs = argsCache[key];
if (!cachedArgs) cachedArgs.reset(new TArray<uint8_t>(args));

View file

@ -169,16 +169,28 @@ void JitCompiler::EmitRET()
if (cc.is64Bit())
{
if (regtype & REGT_KONST)
cc.mov(x86::qword_ptr(location), asmjit::imm_ptr(konsta[regnum].v));
{
auto ptr = newTempIntPtr();
cc.mov(ptr, asmjit::imm_ptr(konsta[regnum].v));
cc.mov(x86::qword_ptr(location), ptr);
}
else
{
cc.mov(x86::qword_ptr(location), regA[regnum]);
}
}
else
{
if (regtype & REGT_KONST)
cc.mov(x86::dword_ptr(location), asmjit::imm_ptr(konsta[regnum].v));
{
auto ptr = newTempIntPtr();
cc.mov(ptr, asmjit::imm_ptr(konsta[regnum].v));
cc.mov(x86::dword_ptr(location), ptr);
}
else
{
cc.mov(x86::dword_ptr(location), regA[regnum]);
}
}
break;
}