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 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;
@ -146,22 +146,16 @@ bool ElfReader::LoadInto(u32 vaddr)
u8 *dst = Memory::GetPointer(writeAddr);
u32 srcSize = p->p_filesz;
u32 dstSize = p->p_memsz;
//PSPHLE::userMemory.AllocAt(writeAddr, dstSize);
//memcpy(dst, src, srcSize);
u32 *s = (u32*)src;
u32 *d = (u32*)dst;
//TODO : remove byteswapping
for (int i=0; i<(int)srcSize/4+1; i++)
for (int j = 0; j < (int)(srcSize + 3) / 4; j++)
{
*d++ = /*_byteswap_ulong*/(*s++);
}
if (srcSize < dstSize)
{
//memset(dst + srcSize, 0, dstSize-srcSize); //zero out bss
}
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);
}
const u8* DoJit(u32 emaddress, JitBlock &b)
{
_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.instructionNumber = i;
if (i == (int)size - 1) js.isLastInstruction = true;
//PPCTables::CompileInstruction(ops[i].inst);
#ifndef _WIN32
if (!js.isLastInstruction)
Default(ops[i].inst);
else
#endif
PPCTables::CompileInstruction(ops[i].inst);
PPCTables::CompileInstruction(ops[i].inst);
gpr.SanityCheck();
fpr.SanityCheck();
}

View File

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

View File

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

View File

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