static-ified a lot of vars to prevent name collisions with plugins, other cosmetic stuff, prep for jit debug

git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@147 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
hrydgard
2008-08-07 21:29:15 +00:00
parent ac366022f4
commit b370386983
26 changed files with 212 additions and 157 deletions

View File

@ -5,13 +5,9 @@
#include "../HW/Memmap.h"
#include "ElfReader.h"
//#include "../PSP/HLE/sceKernelMemory.h"
void bswap(Elf32_Word &w) {w = Common::swap32(w);}
void bswap(Elf32_Half &w) {w = Common::swap16(w);}
void byteswapHeader(Elf32_Ehdr &ELF_H)
{
bswap(ELF_H.e_type);

View File

@ -29,11 +29,12 @@
#include "PowerPC/Jit64/JitCache.h"
#include "PowerPCDisasm.h"
#define CASE(x) else if (memcmp(cmd, x,4*sizeof(TCHAR))==0)
#define CASE1(x) if (memcmp(cmd, x,2*sizeof(TCHAR))==0)
#define CASE(x) else if (memcmp(cmd, x, 4*sizeof(TCHAR))==0)
#define CASE1(x) if (memcmp(cmd, x, 2*sizeof(TCHAR))==0)
Common::Thread *cons_thread;
/*
static Common::Thread *cons_thread;
THREAD_RETURN ConsoleThreadFunc(void *) {
printf("Welcome to the console thread!\n\n");
while (true) {

View File

@ -27,7 +27,7 @@
namespace Debugger
{
XVectorSymbol m_VectorSymbols;
static XVectorSymbol m_VectorSymbols;
CSymbol::CSymbol(u32 _Address, u32 _Size, ESymbolType _Type, const char *_rName) :
vaddress(_Address),

View File

@ -45,7 +45,7 @@ struct SPatch
int returnType;
};
SPatch OSPatches[] =
static const SPatch OSPatches[] =
{
{ "FAKE_TO_SKIP_0", HLE_Misc::UnimplementedFunction },
@ -69,7 +69,7 @@ SPatch OSPatches[] =
// { "GXPeekARGB", HLE_Misc::GXPeekARGB},
};
SPatch OSBreakPoints[] =
static const SPatch OSBreakPoints[] =
{
{ "FAKE_TO_SKIP_0", HLE_Misc::UnimplementedFunction },
};

View File

@ -28,9 +28,9 @@
using namespace PowerPC;
namespace {
bool g_Branch;
Common::Event m_StepEvent;
Common::Event *m_SyncEvent;
static bool g_Branch;
static Common::Event m_StepEvent;
static Common::Event *m_SyncEvent;
}
void CCPU::Init()

View File

@ -264,9 +264,9 @@ namespace Jit64
// windoze goes to 8010feb0
// after they they are completely out of sync.
// branches from the cmp result of r0, which comes from an lbz (loaded from stack)
bool ImHereDebug = false;
bool ImHereLog = false;
std::map<u32, int> been_here;
static const bool ImHereDebug = false;
static const bool ImHereLog = false;
static std::map<u32, int> been_here;
void ImHere()
{
static FILE *f = 0;

View File

@ -45,17 +45,17 @@ const u8 *dispatcherNoCheck;
const u8 *dispatcherPcInEAX;
const u8 *computeRc;
bool blockMode = false; //doesn't work as true!
static bool blockMode = false; //doesn't work as true!
bool compareEnabled = false;
//TODO - make an option
//#if _DEBUG
bool enableDebug = false;
static bool enableDebug = false;
//#else
// bool enableDebug = false;
//#endif
bool enableStatistics = false;
static bool enableStatistics = false;
//GLOBAL STATIC ALLOCATIONS x86
//EAX - ubiquitous scratch register - EVERYBODY scratches this

View File

@ -39,9 +39,9 @@ using namespace Gen;
namespace Jit64
{
u8 *codeCache;
u8 *genFunctions;
u8 *trampolineCache;
static u8 *codeCache;
static u8 *genFunctions;
static u8 *trampolineCache;
u8 *trampolineCodePtr;
#define INVALID_EXIT 0xFFFFFFFF
void LinkBlockExits(int i);
@ -55,15 +55,14 @@ namespace Jit64
MAX_NUM_BLOCKS = 65536,
};
u8 **blockCodePointers; // cut these in half and force below 2GB?
static u8 **blockCodePointers; // cut these in half and force below 2GB?
std::multimap<u32, int> links_to;
JitBlock *blocks;
int numBlocks;
static std::multimap<u32, int> links_to;
static JitBlock *blocks;
static int numBlocks;
//stats
int numFlushes;
static int numFlushes;
void PrintStats()
{

View File

@ -27,10 +27,8 @@
#include "../../HW/SerialInterface.h"
#include "../../Core.h"
namespace Jit64
{
void Jit64Core::Init()
{
InitCache();

View File

@ -14,6 +14,8 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include "../PowerPC.h"
#include "../PPCTables.h"
#include "x64Emitter.h"
@ -23,6 +25,9 @@
#include "JitCache.h"
#include "JitAsm.h"
// The branches are known good, or at least reasonably good.
// No need for a disable-mechanism.
using namespace Gen;
namespace Jit64
{

View File

@ -24,6 +24,9 @@
#include "JitCache.h"
#include "JitRegCache.h"
// #define INSTRUCTION_START Default(inst); return;
#define INSTRUCTION_START
namespace Jit64
{
const u64 GC_ALIGNED16(psSignBits2[2]) = {0x8000000000000000ULL, 0x8000000000000000ULL};
@ -46,7 +49,7 @@ namespace Jit64
}
else if (a != d && b != d)
{
//sources different from d, can use rather quick solution
// Sources different from d, can use rather quick solution
fpr.LoadToX64(d, !dupe);
MOVSD(fpr.RX(d), fpr.R(a));
fpr.GetReadyForOp(d, b);
@ -59,7 +62,7 @@ namespace Jit64
MOVSD(fpr.RX(d), fpr.R(a));
op(fpr.RX(d), Gen::R(XMM0));
}
else //Other combo, must use two temps :(
else // Other combo, must use two temps :(
{
MOVSD(XMM0, fpr.R(a));
MOVSD(XMM1, fpr.R(b));
@ -76,6 +79,7 @@ namespace Jit64
void fp_arith_s(UGeckoInstruction inst)
{
INSTRUCTION_START;
bool dupe = inst.OPCD == 59;
switch (inst.SUBOP5)
{
@ -94,11 +98,9 @@ namespace Jit64
}
}
void fmaddXX(UGeckoInstruction inst)
{
LOG(DYNA_REC, "Got one %08x", js.compilerPC);
INSTRUCTION_START;
int a = inst.FA;
int b = inst.FB;
int c = inst.FC;
@ -128,14 +130,15 @@ namespace Jit64
break;
}
fpr.LoadToX64(d, false);
//YES it is necessary to dupe :(
//TODO : analysis - does the top reg get used?
MOVDDUP(fpr.RX(d), Gen::R(XMM0)); //can also be done with SHUF
//YES it is necessary to dupe the result :(
//TODO : analysis - does the top reg get used? If so, dupe, if not, don't.
MOVDDUP(fpr.RX(d), Gen::R(XMM0));
fpr.UnlockAll();
}
void fcmpx(UGeckoInstruction inst)
{
INSTRUCTION_START;
if (jo.fpAccurateFlags)
{
Default(inst);

View File

@ -14,6 +14,7 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "../PowerPC.h"
#include "../PPCTables.h"
#include "x64Emitter.h"
@ -23,16 +24,16 @@
#include "JitRegCache.h"
#include "JitAsm.h"
#define OLD
//#define OLD Default(inst); return;
// #define INSTRUCTION_START Default(inst); return;
#define INSTRUCTION_START
namespace Jit64
{
typedef u32 (*Operation)(u32 a, u32 b);
u32 Add(u32 a, u32 b) {return a+b;}
u32 Or (u32 a, u32 b) {return a|b;}
u32 And(u32 a, u32 b) {return a&b;}
u32 Xor(u32 a, u32 b) {return a^b;}
u32 Add(u32 a, u32 b) {return a + b;}
u32 Or (u32 a, u32 b) {return a | b;}
u32 And(u32 a, u32 b) {return a & b;}
u32 Xor(u32 a, u32 b) {return a ^ b;}
void regimmop(int d, int a, bool binary, u32 value, Operation doop, void(*op)(int, const OpArg&, const OpArg&), bool Rc = false)
{
@ -78,19 +79,20 @@ namespace Jit64
void reg_imm(UGeckoInstruction inst)
{
INSTRUCTION_START;
int d = inst.RD, a = inst.RA, s = inst.RS;
switch (inst.OPCD)
{
case 14: regimmop(d,a,false,(u32)(s32)inst.SIMM_16,Add,ADD); break; //addi
case 15: regimmop(d,a,false,(u32)inst.SIMM_16<<16,Add,ADD); break; //addis
case 14: regimmop(d, a, false, (u32)(s32)inst.SIMM_16, Add, ADD); break; //addi
case 15: regimmop(d, a, false, (u32)inst.SIMM_16 << 16, Add, ADD); break; //addis
case 24:
if (a == 0 && s == 0 && inst.UIMM == 0) //check for nop
{NOP();return;} //make the nop visible.. or turn to int3? we shouldn't get nops
regimmop(a,s,true,inst.UIMM,Or,OR);
{NOP(); return;} //make the nop visible.. or turn to int3? we shouldn't get nops
regimmop(a, s, true, inst.UIMM, Or, OR);
break;//ori
case 25: regimmop(a,s,true,inst.UIMM<<16,Or,OR); break;//oris
case 28: regimmop(a,s,true,inst.UIMM,And,AND,true); break;
case 29: regimmop(a,s,true,inst.UIMM<<16,And,AND,true); break;
case 25: regimmop(a, s, true, inst.UIMM << 16, Or, OR, false); break;//oris
case 28: regimmop(a, s, true, inst.UIMM, And, AND, true); break;
case 29: regimmop(a, s, true, inst.UIMM << 16, And, AND, true); break;
case 12: //addic
case 13: //addic_rc
case 26: //xori
@ -104,6 +106,7 @@ namespace Jit64
// unsigned
void cmpli(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA;
u32 uimm = inst.UIMM;
int crf = inst.CRFD;
@ -152,7 +155,7 @@ namespace Jit64
// signed
void cmpi(UGeckoInstruction inst)
{
OLD;
INSTRUCTION_START;
int a = inst.RA;
s32 simm = (s32)(s16)inst.UIMM;
int crf = inst.CRFD;
@ -180,6 +183,7 @@ namespace Jit64
// signed
void cmp(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA;
int b = inst.RB;
int crf = inst.CRFD;
@ -209,6 +213,7 @@ namespace Jit64
// unsigned
void cmpl(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA;
int b = inst.RB;
int crf = inst.CRFD;
@ -237,6 +242,7 @@ namespace Jit64
void orx(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA;
int s = inst.RS;
int b = inst.RB;
@ -271,6 +277,7 @@ namespace Jit64
void andx(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA, s = inst.RS, b = inst.RB;
if (a != s && a != b) {
gpr.LoadToX64(a, false, true);
@ -291,6 +298,7 @@ namespace Jit64
void extsbx(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA, s = inst.RS;
gpr.LoadToX64(a, a == s, true);
gpr.KillImmediate(s);
@ -304,6 +312,7 @@ namespace Jit64
void extshx(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA, s = inst.RS;
gpr.LoadToX64(a, a == s, true);
gpr.KillImmediate(s);
@ -316,6 +325,7 @@ namespace Jit64
void subfic(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA, d = inst.RD;
gpr.FlushR(ECX);
gpr.LockX(ECX);
@ -341,6 +351,7 @@ namespace Jit64
void subfx(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA, b = inst.RB, d = inst.RD;
gpr.Lock(a, b, d);
if (d != a && d != b) {
@ -361,6 +372,7 @@ namespace Jit64
void mulli(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA, d = inst.RD;
gpr.FlushR(EDX);
gpr.LockX(EDX);
@ -380,6 +392,7 @@ namespace Jit64
void mullwx(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA, b = inst.RB, d = inst.RD;
gpr.FlushR(EDX);
gpr.LockX(EDX);
@ -403,6 +416,7 @@ namespace Jit64
void mulhwux(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA, b = inst.RB, d = inst.RD;
gpr.FlushR(EDX);
gpr.LockX(EDX);
@ -469,6 +483,7 @@ namespace Jit64
void addx(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA, b = inst.RB, d = inst.RD;
_assert_msg_(DYNA_REC, !inst.OE, "Add - OE enabled :(");
@ -519,6 +534,7 @@ namespace Jit64
// This can be optimized
void addex(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA, b = inst.RB, d = inst.RD;
gpr.FlushR(ECX);
gpr.LockX(ECX);
@ -546,6 +562,7 @@ namespace Jit64
void rlwinmx(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA;
int s = inst.RS;
if (gpr.R(a).IsImm() || gpr.R(s).IsImm())
@ -596,7 +613,7 @@ namespace Jit64
void rlwimix(UGeckoInstruction inst)
{
OLD;
INSTRUCTION_START;
int a = inst.RA;
int s = inst.RS;
if (gpr.R(a).IsImm() || gpr.R(s).IsImm())
@ -628,6 +645,7 @@ namespace Jit64
void rlwnmx(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA, b = inst.RB, s = inst.RS;
if (gpr.R(a).IsImm())
{
@ -657,6 +675,7 @@ namespace Jit64
void srwx(UGeckoInstruction inst)
{
INSTRUCTION_START;
// BUGGY?
Default(inst); return;
int a = inst.RA;
@ -690,6 +709,7 @@ namespace Jit64
// another crazy instruction :(
void srawix(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA;
int s = inst.RS;
int amount = inst.SH;
@ -731,6 +751,7 @@ namespace Jit64
void cntlzwx(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA;
int s = inst.RS;
if (gpr.R(a).IsImm() || gpr.R(s).IsImm() || s == a)

View File

@ -18,6 +18,8 @@
// TODO(ector): Tons of pshufb optimization of the loads/stores, for SSSE3+, possibly SSE4, only.
// Should give a very noticable speed boost to paired single heavy code.
#include "Common.h"
#include "../PowerPC.h"
#include "../../Core.h"
#include "../../HW/GPFifo.h"
@ -33,13 +35,13 @@
#include "JitAsm.h"
#include "JitRegCache.h"
#define OLD
//#define OLD Default(inst); return;
// #define INSTRUCTION_START Default(inst); return;
#define INSTRUCTION_START
#ifdef _M_IX86
#define BIT32OLD Default(inst); return;
#define DISABLE_32BIT Default(inst); return;
#else
#define BIT32OLD ;
#define DISABLE_32BIT ;
#endif
namespace Jit64
@ -81,6 +83,7 @@ namespace Jit64
void lbzx(UGeckoInstruction inst)
{
INSTRUCTION_START;
int a = inst.RA, b = inst.RB, d = inst.RD;
gpr.Lock(a, b, d);
if (b == d || a == d)
@ -97,6 +100,7 @@ namespace Jit64
void lXz(UGeckoInstruction inst)
{
INSTRUCTION_START;
int d = inst.RD;
int a = inst.RA;
@ -171,7 +175,7 @@ namespace Jit64
void lfs(UGeckoInstruction inst)
{
// BIT32OLD;
INSTRUCTION_START;
int d = inst.RD;
int a = inst.RA;
if (!a)
@ -211,7 +215,8 @@ namespace Jit64
void lfd(UGeckoInstruction inst)
{
BIT32OLD;
INSTRUCTION_START;
DISABLE_32BIT;
int d = inst.RD;
int a = inst.RA;
if (!a)
@ -235,8 +240,8 @@ namespace Jit64
void stfd(UGeckoInstruction inst)
{
BIT32OLD;
OLD;
INSTRUCTION_START;
DISABLE_32BIT;
int s = inst.RS;
int a = inst.RA;
if (!a)
@ -259,8 +264,8 @@ namespace Jit64
void stfs(UGeckoInstruction inst)
{
BIT32OLD;
OLD;
INSTRUCTION_START;
DISABLE_32BIT;
bool update = inst.OPCD & 1;
int s = inst.RS;
int a = inst.RA;
@ -301,10 +306,8 @@ namespace Jit64
void lfsx(UGeckoInstruction inst)
{
#ifdef _M_IX86
Default(inst);
return;
#endif
INSTRUCTION_START;
DISABLE_32BIT;
fpr.Lock(inst.RS);
fpr.LoadToX64(inst.RS, false, true);
MOV(32, R(EAX), gpr.R(inst.RB));
@ -321,10 +324,8 @@ namespace Jit64
// Zero cache line.
void dcbz(UGeckoInstruction inst)
{
#ifdef _M_IX86
Default(inst);
return;
#endif
INSTRUCTION_START;
DISABLE_32BIT;
MOV(32, R(EAX), gpr.R(inst.RB));
if (inst.RA)
ADD(32, R(EAX), gpr.R(inst.RA));
@ -336,6 +337,7 @@ namespace Jit64
void stX(UGeckoInstruction inst)
{
INSTRUCTION_START;
int s = inst.RS;
int a = inst.RA;
@ -471,6 +473,7 @@ namespace Jit64
// A few games use these heavily.
void lmw(UGeckoInstruction inst)
{
INSTRUCTION_START;
Default(inst);
return;
/// BUGGY
@ -496,6 +499,7 @@ namespace Jit64
void stmw(UGeckoInstruction inst)
{
INSTRUCTION_START;
Default(inst);
return;
/*

View File

@ -18,6 +18,8 @@
// TODO(ector): Tons of pshufb optimization of the loads/stores, for SSSE3+, possibly SSE4, only.
// Should give a very noticable speed boost to paired single heavy code.
#include "Common.h"
#include "../PowerPC.h"
#include "../../Core.h"
#include "../../HW/GPFifo.h"
@ -33,13 +35,13 @@
#include "JitAsm.h"
#include "JitRegCache.h"
#define OLD
//#define OLD Default(inst); return;
// #define INSTRUCTION_START Default(inst); return;
#define INSTRUCTION_START
#ifdef _M_IX86
#define BIT32OLD Default(inst); return;
#define DISABLE_32BIT Default(inst); return;
#else
#define BIT32OLD ;
#define DISABLE_32BIT ;
#endif
namespace Jit64 {
@ -47,7 +49,7 @@ 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)
@ -56,7 +58,7 @@ void WriteDual32(u64 value, u32 address)
Memory::Write_U32((u32)value, address + 4);
}
const double m_quantizeTableD[] =
static const double m_quantizeTableD[] =
{
(1 << 0), (1 << 1), (1 << 2), (1 << 3),
(1 << 4), (1 << 5), (1 << 6), (1 << 7),
@ -76,7 +78,7 @@ const double m_quantizeTableD[] =
1.0 / (1 << 4), 1.0 / (1 << 3), 1.0 / (1 << 2), 1.0 / (1 << 1),
};
const double m_dequantizeTableD[] =
static const double 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),
@ -98,11 +100,10 @@ const double m_dequantizeTableD[] =
// The big problem is likely instructions that set the quantizers in the same block.
// We will have to break block after quantizers are written to.
u32 temp;
void psq_st(UGeckoInstruction inst)
{
BIT32OLD;
OLD;
INSTRUCTION_START;
DISABLE_32BIT;
if (js.blockSetsQuantizers || !Core::GetStartupParameter().bOptimizeQuantizers)
{
Default(inst);
@ -112,7 +113,7 @@ void psq_st(UGeckoInstruction inst)
const EQuantizeType stType = static_cast<EQuantizeType>(gqr.ST_TYPE);
int stScale = gqr.ST_SCALE;
bool update = inst.OPCD == 61;
if (update || !inst.RA || inst.W)
if (!inst.RA || inst.W)
{
// PanicAlert(inst.RA ? "W" : "inst");
Default(inst);
@ -223,8 +224,8 @@ void psq_st(UGeckoInstruction inst)
void psq_l(UGeckoInstruction inst)
{
BIT32OLD;
OLD;
INSTRUCTION_START;
DISABLE_32BIT;
if (js.blockSetsQuantizers || !Core::GetStartupParameter().bOptimizeQuantizers)
{
Default(inst);
@ -234,7 +235,7 @@ void psq_l(UGeckoInstruction inst)
const EQuantizeType ldType = static_cast<EQuantizeType>(gqr.LD_TYPE);
int ldScale = gqr.LD_SCALE;
bool update = inst.OPCD == 57;
if (update || !inst.RA || inst.W)
if (!inst.RA || inst.W)
{
// 0 1 during load
//PanicAlert("ld:%i %i", ldType, (int)inst.W);

View File

@ -14,6 +14,9 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include "../PowerPC.h"
#include "../PPCTables.h"
#include "x64Emitter.h"
@ -29,18 +32,24 @@
// ps_madds1
//#define OLD Default(inst); return;
#define OLD
// #define INSTRUCTION_START Default(inst); return;
#define INSTRUCTION_START
#ifdef _M_IX86
#define DISABLE_32BIT Default(inst); return;
#else
#define DISABLE_32BIT ;
#endif
namespace Jit64
{
const u64 GC_ALIGNED16(psSignBits[2]) = {0x8000000000000000ULL, 0x8000000000000000ULL};
const u64 GC_ALIGNED16(psAbsMask[2]) = {0x7FFFFFFFFFFFFFFFULL, 0x7FFFFFFFFFFFFFFFULL};
const double GC_ALIGNED16(psOneOne[2]) = {1.0, 1.0};
static const u64 GC_ALIGNED16(psSignBits[2]) = {0x8000000000000000ULL, 0x8000000000000000ULL};
static const u64 GC_ALIGNED16(psAbsMask[2]) = {0x7FFFFFFFFFFFFFFFULL, 0x7FFFFFFFFFFFFFFFULL};
static const double GC_ALIGNED16(psOneOne[2]) = {1.0, 1.0};
void ps_sign(UGeckoInstruction inst)
{
OLD;
INSTRUCTION_START;
int d = inst.FD;
int b = inst.FB;
@ -73,6 +82,7 @@ namespace Jit64
void ps_rsqrte(UGeckoInstruction inst)
{
INSTRUCTION_START;
int d = inst.FD;
int b = inst.FB;
fpr.Lock(d, b);
@ -143,7 +153,7 @@ namespace Jit64
void ps_arith(UGeckoInstruction inst)
{
OLD;
INSTRUCTION_START;
switch (inst.SUBOP5)
{
case 18: tri_op(inst.FD, inst.FA, inst.FB, false, &DIVPD); break; //div
@ -164,7 +174,7 @@ namespace Jit64
//TODO: find easy cases and optimize them, do a breakout like ps_arith
void ps_mergeXX(UGeckoInstruction inst)
{
OLD;
INSTRUCTION_START;
int d = inst.FD;
int a = inst.FA;
int b = inst.FB;
@ -202,7 +212,7 @@ namespace Jit64
//TODO: add optimized cases
void ps_maddXX(UGeckoInstruction inst)
{
OLD;
INSTRUCTION_START;
int a = inst.FA;
int b = inst.FB;
int c = inst.FC;
@ -243,6 +253,7 @@ namespace Jit64
void ps_mulsX(UGeckoInstruction inst)
{
INSTRUCTION_START;
Default(inst);
return;

View File

@ -14,6 +14,9 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include "Common.h"
#include "../../CoreTiming.h"
#include "../../HW/SystemTimers.h"
#include "../PowerPC.h"
@ -24,10 +27,20 @@
#include "JitCache.h"
#include "JitRegCache.h"
// #define INSTRUCTION_START Default(inst); return;
#define INSTRUCTION_START
#ifdef _M_IX86
#define DISABLE_32BIT Default(inst); return;
#else
#define DISABLE_32BIT ;
#endif
namespace Jit64
{
void mtspr(UGeckoInstruction inst)
{
INSTRUCTION_START;
u32 iIndex = (inst.SPRU << 5) | (inst.SPRL & 0x1F);
int d = inst.RD;
@ -65,6 +78,7 @@ namespace Jit64
void mfspr(UGeckoInstruction inst)
{
INSTRUCTION_START;
u32 iIndex = (inst.SPRU << 5) | (inst.SPRL & 0x1F);
int d = inst.RD;
switch (iIndex)
@ -87,12 +101,14 @@ namespace Jit64
void mtmsr(UGeckoInstruction inst)
{
INSTRUCTION_START;
gpr.LoadToX64(inst.RS);
MOV(32, M(&MSR), gpr.R(inst.RS));
}
void mfmsr(UGeckoInstruction inst)
{
INSTRUCTION_START;
//Privileged?
gpr.LoadToX64(inst.RD, false);
MOV(32, gpr.R(inst.RD), M(&MSR));
@ -100,6 +116,7 @@ namespace Jit64
void mftb(UGeckoInstruction inst)
{
INSTRUCTION_START;
mfspr(inst);
}
}

View File

@ -14,8 +14,10 @@
// Official SVN repository and contact information can be found at
// http://code.google.com/p/dolphin-emu/
#include <algorithm>
#include "Common.h"
#include "PPCTables.h"
#include "Interpreter/Interpreter.h"
@ -38,20 +40,21 @@ struct GekkoOPTemplate
int runCount;
};
// The eventual goal is to be able to constify as much as possible in this file.
// Currently, the main obstacle is runCount above.
static GekkoOPInfo *m_infoTable[64];
static GekkoOPInfo *m_infoTable4[1024];
static GekkoOPInfo *m_infoTable19[1024];
static GekkoOPInfo *m_infoTable31[1024];
static GekkoOPInfo *m_infoTable59[32];
static GekkoOPInfo *m_infoTable63[1024];
GekkoOPInfo *m_infoTable[64];
GekkoOPInfo *m_infoTable4[1024];
GekkoOPInfo *m_infoTable19[1024];
GekkoOPInfo *m_infoTable31[1024];
GekkoOPInfo *m_infoTable59[32];
GekkoOPInfo *m_infoTable63[1024];
_recompilerInstruction dynaOpTable[64];
_recompilerInstruction dynaOpTable4[1024];
_recompilerInstruction dynaOpTable19[1024];
_recompilerInstruction dynaOpTable31[1024];
_recompilerInstruction dynaOpTable59[32];
_recompilerInstruction dynaOpTable63[1024];
static _recompilerInstruction dynaOpTable[64];
static _recompilerInstruction dynaOpTable4[1024];
static _recompilerInstruction dynaOpTable19[1024];
static _recompilerInstruction dynaOpTable31[1024];
static _recompilerInstruction dynaOpTable59[32];
static _recompilerInstruction dynaOpTable63[1024];
void DynaRunTable4(UGeckoInstruction _inst) {dynaOpTable4 [_inst.SUBOP10](_inst);}
void DynaRunTable19(UGeckoInstruction _inst) {dynaOpTable19[_inst.SUBOP10](_inst);}
@ -59,9 +62,8 @@ void DynaRunTable31(UGeckoInstruction _inst) {dynaOpTable31[_inst.SUBOP10](_inst
void DynaRunTable59(UGeckoInstruction _inst) {dynaOpTable59[_inst.SUBOP5 ](_inst);}
void DynaRunTable63(UGeckoInstruction _inst) {dynaOpTable63[_inst.SUBOP10](_inst);}
GekkoOPInfo *m_allInstructions[2048];
int m_numInstructions;
static GekkoOPInfo *m_allInstructions[2048];
static int m_numInstructions;
GekkoOPInfo *GetOpInfo(UGeckoInstruction _inst)
{

View File

@ -84,4 +84,4 @@ void BreakPointDlg::OnOK(wxCommandEvent& /*event*/)
void BreakPointDlg::OnCancel(wxCommandEvent& /*event*/)
{
Close();
}
}

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="Windows-1252"?>
<VisualStudioProject
ProjectType="Visual C++"
Version="8,00"
Version="8.00"
Name="VideoCommon"
ProjectGUID="{E5D1F0C0-AA07-4841-A4EB-4CF4DAA6B0FA}"
RootNamespace="VideoCommon"
@ -405,10 +405,6 @@
RelativePath=".\Src\CPMemory.h"
>
</File>
<File
RelativePath=".\Src\GPUInterface.h"
>
</File>
<File
RelativePath=".\Src\LookUpTables.cpp"
>