Enable more parts of the JIT under linux

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@152 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard 2008-08-08 17:52:37 +00:00
parent 6b8d9e1bb0
commit c8c1d2d905
6 changed files with 13 additions and 21 deletions

View File

@ -131,7 +131,7 @@ bool ElfReader::LoadInto(u32 vaddr)
u32 segmentVAddr[32]; u32 segmentVAddr[32];
u32 baseAddress = bRelocate?vaddr:0; u32 baseAddress = bRelocate?vaddr:0;
for (int i=0; i<header->e_phnum; i++) for (int i = 0; i < header->e_phnum; i++)
{ {
Elf32_Phdr *p = segments + i; Elf32_Phdr *p = segments + i;
@ -146,22 +146,16 @@ bool ElfReader::LoadInto(u32 vaddr)
u8 *dst = Memory::GetPointer(writeAddr); u8 *dst = Memory::GetPointer(writeAddr);
u32 srcSize = p->p_filesz; u32 srcSize = p->p_filesz;
u32 dstSize = p->p_memsz; u32 dstSize = p->p_memsz;
//PSPHLE::userMemory.AllocAt(writeAddr, dstSize);
//memcpy(dst, src, srcSize);
u32 *s = (u32*)src; u32 *s = (u32*)src;
u32 *d = (u32*)dst; u32 *d = (u32*)dst;
for (int j = 0; j < (int)(srcSize + 3) / 4; j++)
//TODO : remove byteswapping
for (int i=0; i<(int)srcSize/4+1; i++)
{ {
*d++ = /*_byteswap_ulong*/(*s++); *d++ = /*_byteswap_ulong*/(*s++);
} }
if (srcSize < dstSize) if (srcSize < dstSize)
{ {
//memset(dst + srcSize, 0, dstSize-srcSize); //zero out bss //memset(dst + srcSize, 0, dstSize-srcSize); //zero out bss
} }
LOG(MASTER_LOG,"Loadable Segment Copied to %08x, size %08x", writeAddr, p->p_memsz); LOG(MASTER_LOG,"Loadable Segment Copied to %08x, size %08x", writeAddr, p->p_memsz);
} }
} }

View File

@ -337,7 +337,6 @@ namespace Jit64
JMP(Asm::testExceptions, true); JMP(Asm::testExceptions, true);
} }
const u8* DoJit(u32 emaddress, JitBlock &b) const u8* DoJit(u32 emaddress, JitBlock &b)
{ {
_assert_msg_(DYNA_REC, emaddress != 0, "ERROR - Trying to compile at 0. LR=%08x",LR); _assert_msg_(DYNA_REC, emaddress != 0, "ERROR - Trying to compile at 0. LR=%08x",LR);
@ -391,13 +390,7 @@ namespace Jit64
js.op = &ops[i]; js.op = &ops[i];
js.instructionNumber = i; js.instructionNumber = i;
if (i == (int)size - 1) js.isLastInstruction = true; if (i == (int)size - 1) js.isLastInstruction = true;
//PPCTables::CompileInstruction(ops[i].inst); PPCTables::CompileInstruction(ops[i].inst);
#ifndef _WIN32
if (!js.isLastInstruction)
Default(ops[i].inst);
else
#endif
PPCTables::CompileInstruction(ops[i].inst);
gpr.SanityCheck(); gpr.SanityCheck();
fpr.SanityCheck(); fpr.SanityCheck();
} }

View File

@ -382,7 +382,7 @@ namespace Jit64
_assert_msg_(DYNA_REC, xr >= 0 && xr < NUMXREGS, "WTF - store - invalid reg"); _assert_msg_(DYNA_REC, xr >= 0 && xr < NUMXREGS, "WTF - store - invalid reg");
xregs[xr].free = true; xregs[xr].free = true;
xregs[xr].dirty = false; xregs[xr].dirty = false;
xregs[xr].ppcReg=-1; xregs[xr].ppcReg = -1;
OpArg newLoc = GetDefaultLocation(i); OpArg newLoc = GetDefaultLocation(i);
MOVAPD(newLoc, xr); MOVAPD(newLoc, xr);
regs[i].location = newLoc; regs[i].location = newLoc;

View File

@ -335,6 +335,10 @@ namespace Jit64
MOVAPS(MComplex(EBX, EAX, SCALE_1, 16), XMM0); MOVAPS(MComplex(EBX, EAX, SCALE_1, 16), XMM0);
} }
#ifndef _WIN32
#define INSTRUCTION_START Default(inst); return;
#endif
void stX(UGeckoInstruction inst) void stX(UGeckoInstruction inst)
{ {
INSTRUCTION_START; INSTRUCTION_START;

View File

@ -35,8 +35,11 @@
#include "JitAsm.h" #include "JitAsm.h"
#include "JitRegCache.h" #include "JitRegCache.h"
// #define INSTRUCTION_START Default(inst); return; #ifdef _WIN32
#define INSTRUCTION_START #define INSTRUCTION_START
#else
#define INSTRUCTION_START Default(inst); return;
#endif
#ifdef _M_IX86 #ifdef _M_IX86
#define DISABLE_32BIT Default(inst); return; #define DISABLE_32BIT Default(inst); return;
@ -48,8 +51,6 @@ namespace Jit64 {
static double GC_ALIGNED16(psTemp[2]) = {1.0, 1.0}; static double GC_ALIGNED16(psTemp[2]) = {1.0, 1.0};
static u64 GC_ALIGNED16(temp64); static u64 GC_ALIGNED16(temp64);
static u32 GC_ALIGNED16(temp32);
static u32 temp;
// TODO(ector): Improve 64-bit version // TODO(ector): Improve 64-bit version
void WriteDual32(u64 value, u32 address) void WriteDual32(u64 value, u32 address)

View File

@ -32,7 +32,7 @@ u32 s_nTargetWidth = 0, s_nTargetHeight = 0;
u32 g_AAx = 0, g_AAy = 0; u32 g_AAx = 0, g_AAy = 0;
#ifndef _WIN32 #ifndef _WIN32
static GLWindow GLWin; GLWindow GLWin;
#endif #endif
#ifdef _WIN32 #ifdef _WIN32