CPU/Recompiler/AArch64: Use PC-relative branches to far code
This commit is contained in:
parent
9f45c67b1d
commit
620284f7d1
|
@ -209,11 +209,7 @@ void CodeGenerator::EmitExceptionExitOnBool(const Value& value)
|
||||||
// TODO: This is... not great.
|
// TODO: This is... not great.
|
||||||
a64::Label skip_branch;
|
a64::Label skip_branch;
|
||||||
m_emit->Cbz(GetHostReg64(value.host_reg), &skip_branch);
|
m_emit->Cbz(GetHostReg64(value.host_reg), &skip_branch);
|
||||||
{
|
EmitBranch(GetCurrentFarCodePointer());
|
||||||
Value temp = m_register_cache.AllocateScratch(RegSize_64);
|
|
||||||
m_emit->Mov(GetHostReg64(temp), reinterpret_cast<intptr_t>(GetCurrentFarCodePointer()));
|
|
||||||
m_emit->Br(GetHostReg64(temp));
|
|
||||||
}
|
|
||||||
m_emit->Bind(&skip_branch);
|
m_emit->Bind(&skip_branch);
|
||||||
|
|
||||||
SwitchToFarCode();
|
SwitchToFarCode();
|
||||||
|
@ -1238,14 +1234,13 @@ Value CodeGenerator::EmitLoadGuestMemory(const Value& address, RegSize size)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_register_cache.PushState();
|
||||||
|
|
||||||
a64::Label load_okay;
|
a64::Label load_okay;
|
||||||
m_emit->Tbz(GetHostReg64(result.host_reg), 63, &load_okay);
|
m_emit->Tbz(GetHostReg64(result.host_reg), 63, &load_okay);
|
||||||
m_emit->Mov(GetHostReg64(result.host_reg), reinterpret_cast<intptr_t>(GetCurrentFarCodePointer()));
|
EmitBranch(GetCurrentFarCodePointer());
|
||||||
m_emit->Br(GetHostReg64(result.host_reg));
|
|
||||||
m_emit->Bind(&load_okay);
|
m_emit->Bind(&load_okay);
|
||||||
|
|
||||||
m_register_cache.PushState();
|
|
||||||
|
|
||||||
// load exception path
|
// load exception path
|
||||||
SwitchToFarCode();
|
SwitchToFarCode();
|
||||||
EmitExceptionExit();
|
EmitExceptionExit();
|
||||||
|
@ -1299,14 +1294,13 @@ void CodeGenerator::EmitStoreGuestMemory(const Value& address, const Value& valu
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_register_cache.PushState();
|
||||||
|
|
||||||
a64::Label store_okay;
|
a64::Label store_okay;
|
||||||
m_emit->Cbnz(GetHostReg64(result.host_reg), &store_okay);
|
m_emit->Cbnz(GetHostReg64(result.host_reg), &store_okay);
|
||||||
m_emit->Mov(GetHostReg64(result.host_reg), reinterpret_cast<intptr_t>(GetCurrentFarCodePointer()));
|
EmitBranch(GetCurrentFarCodePointer());
|
||||||
m_emit->Br(GetHostReg64(result.host_reg));
|
|
||||||
m_emit->Bind(&store_okay);
|
m_emit->Bind(&store_okay);
|
||||||
|
|
||||||
m_register_cache.PushState();
|
|
||||||
|
|
||||||
// store exception path
|
// store exception path
|
||||||
SwitchToFarCode();
|
SwitchToFarCode();
|
||||||
EmitExceptionExit();
|
EmitExceptionExit();
|
||||||
|
|
Loading…
Reference in New Issue