mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 14:19:46 -06:00
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:
@ -100,15 +100,10 @@ typedef union _LARGE_INTEGER
|
||||
} LARGE_INTEGER;
|
||||
#endif
|
||||
|
||||
#if defined (__MINGW32__) || defined (_WIN32)
|
||||
#define GC_ALIGNED16(x) __declspec(align(16)) x
|
||||
#define GC_ALIGNED16_DECL(x) x
|
||||
#else
|
||||
#define GC_ALIGNED16(x) x
|
||||
#define GC_ALIGNED64(x) x
|
||||
#define GC_ALIGNED16_DECL(x) x __attribute((aligned(16)))
|
||||
#define GC_ALIGNED64_DECL(x) x
|
||||
#endif
|
||||
#define GC_ALIGNED16(x) __attribute((aligned(16))) x
|
||||
#define GC_ALIGNED64(x) __attribute((aligned(64))) x
|
||||
#define GC_ALIGNED16_DECL(x) __attribute((aligned(16))) x
|
||||
#define GC_ALIGNED64_DECL(x) __attribute((aligned(64))) x
|
||||
|
||||
#ifndef __forceinline
|
||||
#define __forceinline inline
|
||||
|
@ -86,7 +86,7 @@ bool DynamicLibrary::Load(const char* filename)
|
||||
if (library) {
|
||||
library_file = filename;
|
||||
}
|
||||
return(library != 0);
|
||||
return library != 0;
|
||||
}
|
||||
|
||||
|
||||
@ -121,14 +121,14 @@ void* DynamicLibrary::Get(const char* funcname) const
|
||||
//PanicAlert("Did not find function %s in library %s.", funcname, library_file.c_str());
|
||||
//}
|
||||
|
||||
return(retval);
|
||||
return retval;
|
||||
|
||||
#else
|
||||
retval = dlsym(library, funcname);
|
||||
|
||||
if (!retval)
|
||||
{
|
||||
printf("%s\n", dlerror());
|
||||
printf("Symbol %s missing in %s (error: %s)\n", funcname, library_file.c_str(), dlerror());
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -58,7 +58,7 @@ void* AllocateExecutableMemory(int size, bool low)
|
||||
| (low ? MAP_32BIT : 0)
|
||||
#endif
|
||||
, -1, 0); // | MAP_FIXED
|
||||
printf("mappah exe %p %i\n", retval, size);
|
||||
// printf("Mapped executable memory at %p (size %i)\n", retval, size);
|
||||
|
||||
if (!retval)
|
||||
{
|
||||
@ -86,7 +86,7 @@ void* AllocateMemoryPages(int size)
|
||||
#else
|
||||
void* retval = mmap(0, size, PROT_READ | PROT_WRITE,
|
||||
MAP_ANONYMOUS | MAP_PRIVATE, -1, 0); // | MAP_FIXED
|
||||
printf("mappah %p %i\n", retval, size);
|
||||
// printf("Mapped memory at %p (size %i)\n", retval, size);
|
||||
|
||||
if (!retval)
|
||||
{
|
||||
|
@ -304,7 +304,7 @@ THREAD_RETURN EmuThread(void *pArg)
|
||||
if (Callback_PeekMessages) {
|
||||
Callback_PeekMessages();
|
||||
}
|
||||
Common::SleepCurrentThread(20);
|
||||
Common::SleepCurrentThread(200);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -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++)
|
||||
|
@ -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
|
||||
{
|
||||
|
@ -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
|
||||
|
@ -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();
|
||||
}
|
||||
|
@ -74,7 +74,6 @@ CPluginManager::ScanForPlugins(wxWindow* _wxWindow)
|
||||
for (size_t i = 0; i < rFilenames.size(); i++)
|
||||
{
|
||||
std::string orig_name = rFilenames[i];
|
||||
printf("Scanning %s\n", rFilenames[i].c_str());
|
||||
std::string FileName;
|
||||
|
||||
if (!SplitPath(rFilenames[i], NULL, &FileName, NULL))
|
||||
@ -94,17 +93,11 @@ CPluginManager::ScanForPlugins(wxWindow* _wxWindow)
|
||||
break;
|
||||
}
|
||||
|
||||
printf("Examining %s\n", FileName.c_str());
|
||||
|
||||
CPluginInfo PluginInfo(orig_name);
|
||||
printf("%s\n", orig_name.c_str());
|
||||
|
||||
if (PluginInfo.IsValid())
|
||||
{
|
||||
m_PluginInfos.push_back(PluginInfo);
|
||||
}
|
||||
|
||||
printf("Valid plugin\n");
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -136,12 +129,8 @@ CPluginInfo::CPluginInfo(const std::string& _rFileName)
|
||||
: m_FileName(_rFileName)
|
||||
, m_Valid(false)
|
||||
{
|
||||
printf("Loading!\n");
|
||||
|
||||
if (Common::CPlugin::Load(_rFileName.c_str()))
|
||||
{
|
||||
printf("Loaded!\n");
|
||||
|
||||
if (Common::CPlugin::GetInfo(m_PluginInfo))
|
||||
{
|
||||
m_Valid = true;
|
||||
@ -152,7 +141,6 @@ CPluginInfo::CPluginInfo(const std::string& _rFileName)
|
||||
}
|
||||
|
||||
Common::CPlugin::Release();
|
||||
printf("Unloaded!\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
|
Reference in New Issue
Block a user