x64 drc support for MinGW64

This commit is contained in:
Barry Harris 2015-05-12 21:15:20 +00:00
parent b23bab9ef1
commit 3c8da6db68
3 changed files with 22 additions and 1 deletions

View File

@ -146,6 +146,10 @@ ifdef BUILD_X86_ASM
endif
ifdef INCLUDE_KILLER_INSTINCT
alldir += burn/drv/midway cpu/adsp2100 cpu/mips3 cpu/mips3/x64
alldir += burn/drv/midway cpu/adsp2100 cpu/mips3
depobj += dcs2k.o ide.o adsp2100.o cop0.o cop1.o mips3.o adsp2100_intf.o mips3_intf.o
ifdef BUILD_X64_EXE
alldir += cpu/mips3/x64
depobj += mips3_x64.o
endif
endif

View File

@ -300,6 +300,9 @@ endif
ifdef BUILD_X64_EXE
DEF := $(DEF) -DBUILD_X64_EXE
ifdef INCLUDE_KILLER_INSTINCT
DEF := $(DEF) -DXBYAK_NO_OP_NAMES -DMIPS3_X64_DRC
endif
endif
ifdef SYMBOL

View File

@ -97,6 +97,10 @@ void mips3_x64::prolog()
// RBX = cpu_state base
push(rbp);
push(rbx);
#ifdef _WIN32
push(rsi);
push(rdi);
#endif
push(r15);
mov(rbp, rsp);
sub(rsp, 16);
@ -113,6 +117,10 @@ void mips3_x64::epilog(bool do_ret)
mov(rax, ADR(m_icounter));
mov(ptr[rax], r15);
pop(r15);
#if _WIN32
pop(rdi);
pop(rsi);
#endif
pop(rbx);
pop(rbp);
if (do_ret)
@ -452,9 +460,15 @@ void mips3_x64::set_next_pc(addr_t addr)
void mips3_x64::fallback(uint32_t opcode, void (mips3::*f)(uint32_t))
{
#ifdef _WIN32
// WIN64 ABI - MICROSOFT
mov(rcx, (size_t) m_core);
mov(edx, opcode);
#else
// SysV AMD64 ABI - GNU
mov(rdi, (size_t) m_core);
mov(esi, opcode);
#endif
mov(rax, (size_t) (void*)f);
call(rax);
}