microVU: minor cleanup using a typedef to eliminate some redundant list.list-> syntax. :)

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3427 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2010-07-08 15:59:52 +00:00
parent 8c66bd87ba
commit 80b92bf529
2 changed files with 16 additions and 18 deletions

View File

@ -91,7 +91,7 @@ _f void mVUinit(VURegs* vuRegsPtr, int vuIndex) {
mVU->regAlloc = new microRegAlloc(mVU->regs); mVU->regAlloc = new microRegAlloc(mVU->regs);
for (u32 i = 0; i < (mVU->progSize / 2); i++) { for (u32 i = 0; i < (mVU->progSize / 2); i++) {
mVU->prog.prog[i].list = new deque<microProgram*>(); mVU->prog.prog[i] = new deque<microProgram*>();
} }
mVU->dispCache = SysMmapEx(NULL, mVUdispCacheSize, 0, (mVU->index ? "Micro VU1 Dispatcher" : "Micro VU0 Dispatcher")); mVU->dispCache = SysMmapEx(NULL, mVUdispCacheSize, 0, (mVU->index ? "Micro VU1 Dispatcher" : "Micro VU0 Dispatcher"));
@ -133,12 +133,12 @@ _f void mVUreset(mV) {
mVU->prog.x86end = (u8*)((uptr)z + (uptr)(mVU->cacheSize - mVUcacheSafeZone)); // "Safe Zone" mVU->prog.x86end = (u8*)((uptr)z + (uptr)(mVU->cacheSize - mVUcacheSafeZone)); // "Safe Zone"
for (u32 i = 0; i < (mVU->progSize / 2); i++) { for (u32 i = 0; i < (mVU->progSize / 2); i++) {
deque<microProgram*>::iterator it = mVU->prog.prog[i].list->begin(); deque<microProgram*>::iterator it = mVU->prog.prog[i]->begin();
for ( ; it != mVU->prog.prog[i].list->end(); it++) { for ( ; it != mVU->prog.prog[i]->end(); it++) {
if (!isVU1) mVUdeleteProg<0>(it[0]); if (!isVU1) mVUdeleteProg<0>(it[0]);
else mVUdeleteProg<1>(it[0]); else mVUdeleteProg<1>(it[0]);
} }
mVU->prog.prog[i].list->clear(); mVU->prog.prog[i]->clear();
mVU->prog.quick[i].block = NULL; mVU->prog.quick[i].block = NULL;
mVU->prog.quick[i].prog = NULL; mVU->prog.quick[i].prog = NULL;
} }
@ -152,12 +152,12 @@ _f void mVUclose(mV) {
// Delete Programs and Block Managers // Delete Programs and Block Managers
for (u32 i = 0; i < (mVU->progSize / 2); i++) { for (u32 i = 0; i < (mVU->progSize / 2); i++) {
deque<microProgram*>::iterator it = mVU->prog.prog[i].list->begin(); deque<microProgram*>::iterator it = mVU->prog.prog[i]->begin();
for ( ; it != mVU->prog.prog[i].list->end(); it++) { for ( ; it != mVU->prog.prog[i]->end(); it++) {
if (!isVU1) mVUdeleteProg<0>(it[0]); if (!isVU1) mVUdeleteProg<0>(it[0]);
else mVUdeleteProg<1>(it[0]); else mVUdeleteProg<1>(it[0]);
} }
safe_delete(mVU->prog.prog[i].list); safe_delete(mVU->prog.prog[i]);
} }
safe_delete(mVU->regAlloc); safe_delete(mVU->regAlloc);
@ -236,7 +236,7 @@ _mVUt _f microProgram* mVUcreateProg(int startPC) {
double cacheUsed =((double)((u32)mVU->prog.x86ptr - (u32)mVU->prog.x86start)) / cacheSize * 100; double cacheUsed =((double)((u32)mVU->prog.x86ptr - (u32)mVU->prog.x86start)) / cacheSize * 100;
ConsoleColors c = vuIndex ? Color_Orange : Color_Magenta; ConsoleColors c = vuIndex ? Color_Orange : Color_Magenta;
Console.WriteLn(c, "microVU%d: Cached MicroPrograms = [%03d] [PC=%04x] [List=%02d] (Cache = %3.3f%%)", Console.WriteLn(c, "microVU%d: Cached MicroPrograms = [%03d] [PC=%04x] [List=%02d] (Cache = %3.3f%%)",
vuIndex, prog->idx, startPC, mVU->prog.prog[startPC].list->size()+1, cacheUsed); vuIndex, prog->idx, startPC, mVU->prog.prog[startPC]->size()+1, cacheUsed);
return prog; return prog;
} }
@ -278,15 +278,15 @@ _mVUt _f bool mVUcmpProg(microProgram& prog, const bool cmpWholeProg) {
_mVUt _f void* mVUsearchProg(u32 startPC, uptr pState) { _mVUt _f void* mVUsearchProg(u32 startPC, uptr pState) {
microVU* mVU = mVUx; microVU* mVU = mVUx;
microProgramQuick& quick = mVU->prog.quick[startPC/8]; microProgramQuick& quick = mVU->prog.quick[startPC/8];
microProgramList& list = mVU->prog.prog [startPC/8]; microProgramList* list = mVU->prog.prog [startPC/8];
if(!quick.prog) { // If null, we need to search for new program if(!quick.prog) { // If null, we need to search for new program
deque<microProgram*>::iterator it( list.list->begin() ); deque<microProgram*>::iterator it( list->begin() );
for ( ; it != list.list->end(); it++) { for ( ; it != list->end(); it++) {
if (mVUcmpProg<vuIndex>(*it[0], 0)) { if (mVUcmpProg<vuIndex>(*it[0], 0)) {
quick.block = it[0]->block[startPC/8]; quick.block = it[0]->block[startPC/8];
quick.prog = it[0]; quick.prog = it[0];
list.list->erase(it); list->erase(it);
list.list->push_front(quick.prog); list->push_front(quick.prog);
return mVUentryGet(mVU, quick.block, startPC, pState); return mVUentryGet(mVU, quick.block, startPC, pState);
} }
} }
@ -298,7 +298,7 @@ _mVUt _f void* mVUsearchProg(u32 startPC, uptr pState) {
void* entryPoint = mVUblockFetch(mVU, startPC, pState); void* entryPoint = mVUblockFetch(mVU, startPC, pState);
quick.block = mVU->prog.cur->block[startPC/8]; quick.block = mVU->prog.cur->block[startPC/8];
quick.prog = mVU->prog.cur; quick.prog = mVU->prog.cur;
list.list->push_front(mVU->prog.cur); list->push_front(mVU->prog.cur);
return entryPoint; return entryPoint;
} }
// If list.quick, then we've already found and recompiled the program ;) // If list.quick, then we've already found and recompiled the program ;)

View File

@ -132,9 +132,7 @@ struct microProgram {
int idx; // Program index int idx; // Program index
}; };
struct microProgramList { typedef deque<microProgram*> microProgramList;
deque<microProgram*>* list; // List of microPrograms who start with the same startPC value
};
struct microProgramQuick { struct microProgramQuick {
microBlockManager* block; // Quick reference to valid microBlockManager for current startPC microBlockManager* block; // Quick reference to valid microBlockManager for current startPC
@ -143,7 +141,7 @@ struct microProgramQuick {
struct microProgManager { struct microProgManager {
microIR<mProgSize> IRinfo; // IR information microIR<mProgSize> IRinfo; // IR information
microProgramList prog [mProgSize/2]; // List of microPrograms indexed by startPC values microProgramList* prog [mProgSize/2]; // List of microPrograms indexed by startPC values
microProgramQuick quick[mProgSize/2]; // Quick reference to valid microPrograms for current execution microProgramQuick quick[mProgSize/2]; // Quick reference to valid microPrograms for current execution
microProgram* cur; // Pointer to currently running MicroProgram microProgram* cur; // Pointer to currently running MicroProgram
int total; // Total Number of valid MicroPrograms int total; // Total Number of valid MicroPrograms