Fix shader cache bugs, improving linux speed. Remove some unnecessary printfs.

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@153 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-08-08 19:46:04 +00:00
parent c8c1d2d905
commit 9626b3bc42
14 changed files with 49 additions and 87 deletions

View File

@ -304,7 +304,7 @@ THREAD_RETURN EmuThread(void *pArg)
if (Callback_PeekMessages) {
Callback_PeekMessages();
}
Common::SleepCurrentThread(20);
Common::SleepCurrentThread(200);
}
}
else

View File

@ -153,6 +153,10 @@ int timeHistory[HISTORYLENGTH] = {0,0,0,0,0};
void Throttle(u64 userdata, int cyclesLate)
{
#ifndef _WIN32
// had some weird problem in linux. will investigate.
return;
#endif
static Common::Timer timer;
for (int i=0; i<HISTORYLENGTH-1; i++)

View File

@ -14,6 +14,7 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include "../PowerPC.h"
@ -24,8 +25,11 @@
#include "JitCache.h"
#include "JitRegCache.h"
// #define INSTRUCTION_START Default(inst); return;
#ifdef _WIN32
#define INSTRUCTION_START
#else
#define INSTRUCTION_START Default(inst); return;
#endif
namespace Jit64
{

View File

@ -129,27 +129,6 @@ namespace Jit64
SetJumpTarget(continue1);
SetJumpTarget(continue2);
OR(32, M(&CR), R(EAX));
/*
alternative
MOV(32, R(EAX), M(&CR));
AND(32, R(EAX), Imm32(~(0xF0000000 >> (crf*4))));
CMP(32, gpr.R(a), Imm32(uimm));
FixupBranch pLesser = J_CC(CC_B);
FixupBranch pGreater = J_CC(CC_A);
OR(32, R(EAX), Imm32(0x20000000 >> shift)); // _x86Reg == 0
FixupBranch continue1 = J();
SetJumpTarget(pGreater);
OR(32, R(EAX), Imm32(0x40000000 >> shift)); // _x86Reg > 0
FixupBranch continue2 = J();
SetJumpTarget(pLesser);
OR(32, R(EAX), Imm32(0x80000000 >> shift)); // _x86Reg < 0
SetJumpTarget(continue1);
SetJumpTarget(continue2);
MOV(32, M(&CR), R(EAX));
*/
}
// signed

View File

@ -35,11 +35,8 @@
#include "JitAsm.h"
#include "JitRegCache.h"
#ifdef _WIN32
#define INSTRUCTION_START
#else
// #define INSTRUCTION_START
#define INSTRUCTION_START Default(inst); return;
#endif
#ifdef _M_IX86
#define DISABLE_32BIT Default(inst); return;
@ -59,7 +56,7 @@ void WriteDual32(u64 value, u32 address)
Memory::Write_U32((u32)value, address + 4);
}
static const double m_quantizeTableD[] =
static const double GC_ALIGNED16(m_quantizeTableD[]) =
{
(1 << 0), (1 << 1), (1 << 2), (1 << 3),
(1 << 4), (1 << 5), (1 << 6), (1 << 7),
@ -79,7 +76,7 @@ static const double m_quantizeTableD[] =
1.0 / (1 << 4), 1.0 / (1 << 3), 1.0 / (1 << 2), 1.0 / (1 << 1),
};
static const double m_dequantizeTableD[] =
static const double GC_ALIGNED16(m_dequantizeTableD[]) =
{
1.0 / (1 << 0), 1.0 / (1 << 1), 1.0 / (1 << 2), 1.0 / (1 << 3),
1.0 / (1 << 4), 1.0 / (1 << 5), 1.0 / (1 << 6), 1.0 / (1 << 7),
@ -149,8 +146,6 @@ void psq_st(UGeckoInstruction inst)
SetJumpTarget(argh);
CALL((void *)&WriteDual32);
SetJumpTarget(arg2);
if (update)
MOV(32, gpr.R(a), R(ABI_PARAM2));
gpr.UnlockAll();
fpr.UnlockAll();
}
@ -164,6 +159,8 @@ void psq_st(UGeckoInstruction inst)
MOV(32, R(ABI_PARAM2), gpr.R(a));
if (offset)
ADD(32, R(ABI_PARAM2), Imm32((u32)offset));
if (update && offset)
MOV(32, gpr.R(a), R(ABI_PARAM2));
MOVAPS(XMM0, fpr.R(s));
MOVDDUP(XMM1, M((void*)&m_quantizeTableD[stScale]));
MULPD(XMM0, R(XMM1));
@ -193,6 +190,8 @@ void psq_st(UGeckoInstruction inst)
MOV(32, R(ABI_PARAM2), gpr.R(a));
if (offset)
ADD(32, R(ABI_PARAM2), Imm32((u32)offset));
if (update)
MOV(32, gpr.R(a), R(ABI_PARAM2));
MOVAPS(XMM0, fpr.R(s));
MOVDDUP(XMM1, M((void*)&m_quantizeTableD[stScale]));
MULPD(XMM0, R(XMM1));
@ -209,8 +208,6 @@ void psq_st(UGeckoInstruction inst)
PUSH(32, R(ABI_PARAM1));
CALL(&Memory::Write_U32);
#endif
if (update)
MOV(32, gpr.R(a), R(ABI_PARAM2));
gpr.UnlockAll();
fpr.UnlockAll();
}