mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-09 00:11:24 +12:00
LLVM stack overflow fix
This commit is contained in:
parent
a342de6143
commit
ec8519b969
3 changed files with 17 additions and 15 deletions
|
@ -2019,14 +2019,14 @@ void Compiler::HACK(u32 index) {
|
||||||
CreateBranch(nullptr, lr_i32, false, true);
|
CreateBranch(nullptr, lr_i32, false, true);
|
||||||
}
|
}
|
||||||
// copied from Compiler::SC()
|
// copied from Compiler::SC()
|
||||||
auto ret_i1 = Call<bool>("PollStatus", m_poll_status_function, m_state.args[CompileTaskState::Args::State]);
|
//auto ret_i1 = Call<bool>("PollStatus", m_poll_status_function, m_state.args[CompileTaskState::Args::State]);
|
||||||
auto cmp_i1 = m_ir_builder->CreateICmpEQ(ret_i1, m_ir_builder->getInt1(true));
|
//auto cmp_i1 = m_ir_builder->CreateICmpEQ(ret_i1, m_ir_builder->getInt1(true));
|
||||||
auto then_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "then_true");
|
//auto then_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "then_true");
|
||||||
auto merge_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "merge_true");
|
//auto merge_bb = GetBasicBlockFromAddress(m_state.current_instruction_address, "merge_true");
|
||||||
m_ir_builder->CreateCondBr(cmp_i1, then_bb, merge_bb);
|
//m_ir_builder->CreateCondBr(cmp_i1, then_bb, merge_bb);
|
||||||
m_ir_builder->SetInsertPoint(then_bb);
|
//m_ir_builder->SetInsertPoint(then_bb);
|
||||||
m_ir_builder->CreateRet(m_ir_builder->getInt32(0xFFFFFFFF));
|
//m_ir_builder->CreateRet(m_ir_builder->getInt32(0xFFFFFFFF));
|
||||||
m_ir_builder->SetInsertPoint(merge_bb);
|
//m_ir_builder->SetInsertPoint(merge_bb);
|
||||||
}
|
}
|
||||||
|
|
||||||
void Compiler::SC(u32 lev) {
|
void Compiler::SC(u32 lev) {
|
||||||
|
@ -6087,6 +6087,8 @@ BranchType ppu_recompiler_llvm::GetBranchTypeFromInstruction(u32 instruction) {
|
||||||
} else if (field2 == 528) {
|
} else if (field2 == 528) {
|
||||||
type = lk ? BranchType::FunctionCall : BranchType::LocalBranch;
|
type = lk ? BranchType::FunctionCall : BranchType::LocalBranch;
|
||||||
}
|
}
|
||||||
|
} else if (field1 == 1 && (instruction & EIF_PERFORM_BLR)) {
|
||||||
|
type = BranchType::Return;
|
||||||
}
|
}
|
||||||
|
|
||||||
return type;
|
return type;
|
||||||
|
|
|
@ -14,7 +14,7 @@ SysCallBase sys_interrupt("sys_interrupt");
|
||||||
|
|
||||||
s32 sys_interrupt_tag_destroy(u32 intrtag)
|
s32 sys_interrupt_tag_destroy(u32 intrtag)
|
||||||
{
|
{
|
||||||
sys_interrupt.Warning("sys_interrupt_tag_destroy(intrtag=%d)", intrtag);
|
sys_interrupt.Warning("sys_interrupt_tag_destroy(intrtag=0x%x)", intrtag);
|
||||||
|
|
||||||
const u32 class_id = intrtag >> 8;
|
const u32 class_id = intrtag >> 8;
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ s32 sys_interrupt_tag_destroy(u32 intrtag)
|
||||||
|
|
||||||
s32 sys_interrupt_thread_establish(vm::ptr<u32> ih, u32 intrtag, u64 intrthread, u64 arg)
|
s32 sys_interrupt_thread_establish(vm::ptr<u32> ih, u32 intrtag, u64 intrthread, u64 arg)
|
||||||
{
|
{
|
||||||
sys_interrupt.Warning("sys_interrupt_thread_establish(ih_addr=0x%x, intrtag=%d, intrthread=%lld, arg=0x%llx)", ih.addr(), intrtag, intrthread, arg);
|
sys_interrupt.Warning("sys_interrupt_thread_establish(ih=*0x%x, intrtag=0x%x, intrthread=%lld, arg=0x%llx)", ih, intrtag, intrthread, arg);
|
||||||
|
|
||||||
const u32 class_id = intrtag >> 8;
|
const u32 class_id = intrtag >> 8;
|
||||||
|
|
||||||
|
@ -130,7 +130,7 @@ s32 sys_interrupt_thread_establish(vm::ptr<u32> ih, u32 intrtag, u64 intrthread,
|
||||||
|
|
||||||
s32 _sys_interrupt_thread_disestablish(u32 ih, vm::ptr<u64> r13)
|
s32 _sys_interrupt_thread_disestablish(u32 ih, vm::ptr<u64> r13)
|
||||||
{
|
{
|
||||||
sys_interrupt.Todo("_sys_interrupt_thread_disestablish(ih=%d)", ih);
|
sys_interrupt.Todo("_sys_interrupt_thread_disestablish(ih=0x%x, r13=*0x%x)", ih, r13);
|
||||||
|
|
||||||
std::shared_ptr<interrupt_handler_t> handler;
|
std::shared_ptr<interrupt_handler_t> handler;
|
||||||
if (!Emu.GetIdManager().GetIDData(ih, handler))
|
if (!Emu.GetIdManager().GetIDData(ih, handler))
|
||||||
|
@ -147,9 +147,9 @@ s32 _sys_interrupt_thread_disestablish(u32 ih, vm::ptr<u64> r13)
|
||||||
return CELL_OK;
|
return CELL_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
void sys_interrupt_thread_eoi()
|
void sys_interrupt_thread_eoi(PPUThread& CPU)
|
||||||
{
|
{
|
||||||
sys_interrupt.Log("sys_interrupt_thread_eoi()");
|
sys_interrupt.Log("sys_interrupt_thread_eoi()");
|
||||||
|
|
||||||
GetCurrentPPUThread().FastStop();
|
CPU.FastStop();
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,4 +11,4 @@ struct interrupt_handler_t
|
||||||
s32 sys_interrupt_tag_destroy(u32 intrtag);
|
s32 sys_interrupt_tag_destroy(u32 intrtag);
|
||||||
s32 sys_interrupt_thread_establish(vm::ptr<u32> ih, u32 intrtag, u64 intrthread, u64 arg);
|
s32 sys_interrupt_thread_establish(vm::ptr<u32> ih, u32 intrtag, u64 intrthread, u64 arg);
|
||||||
s32 _sys_interrupt_thread_disestablish(u32 ih, vm::ptr<u64> r13);
|
s32 _sys_interrupt_thread_disestablish(u32 ih, vm::ptr<u64> r13);
|
||||||
void sys_interrupt_thread_eoi();
|
void sys_interrupt_thread_eoi(PPUThread& CPU);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue