Skip to content

Commit

Permalink
x86 dynarec: use UpdateSystem_INTC like other recs
Browse files Browse the repository at this point in the history
get rid of unused rdv_DoInterrupts and rdv_DoInterrupts_pc
  • Loading branch information
flyinghead committed Mar 9, 2023
1 parent 0b1f69b commit 5644e83
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 25 deletions.
17 changes: 0 additions & 17 deletions core/hw/sh4/dyna/driver.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -213,23 +213,6 @@ static void ngen_FailedToFindBlock_internal() {

void (*ngen_FailedToFindBlock)() = &ngen_FailedToFindBlock_internal;

u32 DYNACALL rdv_DoInterrupts_pc(u32 pc) {
next_pc = pc;
UpdateINTC();

return next_pc;
}

u32 DYNACALL rdv_DoInterrupts(void* block_cpde)
{
RuntimeBlockInfoPtr rbi = bm_GetBlock(block_cpde);
if (!rbi)
rbi = bm_GetStaleBlock(block_cpde);
verify(rbi != nullptr);

return rdv_DoInterrupts_pc(rbi->vaddr);
}

// addr must be the physical address of the start of the block
DynarecCodeEntryPtr DYNACALL rdv_BlockCheckFail(u32 addr)
{
Expand Down
3 changes: 0 additions & 3 deletions core/hw/sh4/dyna/ngen.h
Original file line number Diff line number Diff line change
Expand Up @@ -80,9 +80,6 @@ DynarecCodeEntryPtr rdv_FindOrCompile();
//code -> pointer to code of block, dpc -> if dynamic block, pc. if cond, 0 for next, 1 for branch
void* DYNACALL rdv_LinkBlock(u8* code,u32 dpc);

u32 DYNACALL rdv_DoInterrupts(void* block_cpde);
u32 DYNACALL rdv_DoInterrupts_pc(u32 pc);

//Stuff to be implemented per dynarec core

void ngen_init();
Expand Down
11 changes: 6 additions & 5 deletions core/rec-x86/rec_x86.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -130,6 +130,7 @@ void X86Compiler::compile(RuntimeBlockInfo* block, bool force_checks, bool optim
test(eax, eax);
Xbyak::Label no_up;
jg(no_up);
mov(ecx, block->vaddr);
call((const void *)intc_sched);
L(no_up);
sub(dword[&Sh4cntx.cycle_counter], block->guest_cycles);
Expand Down Expand Up @@ -485,9 +486,8 @@ void X86Compiler::genMainloop()
//do_iter:
Xbyak::Label do_iter;
L(do_iter);
pop(ecx);
call((void *)rdv_DoInterrupts);
mov(ecx, eax);
add(esp, 4); // pop intc_sched() return address
mov(ecx, dword[&Sh4cntx.pc]);
jmp(no_updateLabel);

//ngen_LinkBlock_Shared_stub:
Expand All @@ -503,14 +503,15 @@ void X86Compiler::genMainloop()

// Functions called by blocks

//intc_sched:
//intc_sched: ecx: vaddr
unwinder.start((void *)getCurr());
size_t startOffset = getSize();
unwinder.endProlog(0);
Xbyak::Label intc_schedLabel;
L(intc_schedLabel);
add(dword[&Sh4cntx.cycle_counter], SH4_TIMESLICE);
call((void *)UpdateSystem);
mov(dword[&Sh4cntx.pc], ecx);
call((void *)UpdateSystem_INTC);
cmp(eax, 0);
jnz(do_iter);
ret();
Expand Down

0 comments on commit 5644e83

Please sign in to comment.