- Minor changes

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@1370 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
cottonvibes 2009-06-15 22:28:05 +00:00
parent 674ac75d6a
commit ce4b58ba61
3 changed files with 19 additions and 25 deletions

View File

@ -277,21 +277,20 @@ microVUt(void) mVUanalyzeR2(mV, int Ft, bool canBeNOP) {
iPC = curPC; \
}
microVUt(void) mVUanalyzeSflag(mV, int It) {
mVUlow.readFlags = 1;
analyzeVIreg2(It, mVUlow.VI_write, 1);
if (!It) { mVUlow.isNOP = 1; }
else {
mVUinfo.swapOps = 1;
mVUsFlagHack = 0; // Don't Optimize Out Status Flags for this block
if (mVUcount < 4) { mVUpBlock->pState.needExactMatch |= 0xf /*<< mVUcount*/; }
flagSet(sFLAG.doNonSticky);
if (mVUcount < 4) { mVUpBlock->pState.needExactMatch |= 0xf; }
if (mVUcount >= 1) { incPC2(-2); mVUlow.useSflag = 1; incPC2(2); }
// Note: useSflag is used for status flag optimizations when a FSSET instruction is called.
// Do to stalls, it can only be set one instruction prior to the status flag read instruction
// if we were guaranteed no-stalls were to happen, it could be set 4 instruction prior.
}
mVUlow.readFlags = 1;
analyzeVIreg2(It, mVUlow.VI_write, 1);
flagSet(sFLAG.doNonSticky);
}
microVUt(void) mVUanalyzeFSSET(mV) {
@ -304,16 +303,15 @@ microVUt(void) mVUanalyzeFSSET(mV) {
//------------------------------------------------------------------
microVUt(void) mVUanalyzeMflag(mV, int Is, int It) {
if (!It) { mVUlow.isNOP = 1; }
else { // Need set _doMac for 4 previous Ops (need to do all 4 because stalls could change the result needed)
mVUinfo.swapOps = 1;
if (mVUcount < 4) { mVUpBlock->pState.needExactMatch |= 0xf << (/*mVUcount +*/ 4); }
}
mVUlow.readFlags = 1;
analyzeVIreg1(Is, mVUlow.VI_read[0]);
analyzeVIreg2(It, mVUlow.VI_write, 1);
flagSet(mFLAG.doFlag);
if (!It) { mVUlow.isNOP = 1; }
else { // Need set _doMac for 4 previous Ops (need to do all 4 because stalls could change the result needed)
mVUinfo.swapOps = 1;
if (mVUcount < 4) { mVUpBlock->pState.needExactMatch |= 0xf << 4; }
flagSet(mFLAG.doFlag);
}
}
//------------------------------------------------------------------
@ -323,7 +321,7 @@ microVUt(void) mVUanalyzeMflag(mV, int Is, int It) {
microVUt(void) mVUanalyzeCflag(mV, int It) {
mVUinfo.swapOps = 1;
mVUlow.readFlags = 1;
if (mVUcount < 4) { mVUpBlock->pState.needExactMatch |= 0xf << (/*mVUcount +*/ 8); }
if (mVUcount < 4) { mVUpBlock->pState.needExactMatch |= 0xf << 8; }
analyzeVIreg2(It, mVUlow.VI_write, 1);
}

View File

@ -164,18 +164,15 @@ declareAllVariables
// Define mVUquickSearch
#ifndef __LINUX__
extern u8 mVUsearchXMM[0x1000];
#endif
typedef u32 (__fastcall *mVUCall)(void*, void*);
#ifndef __LINUX__
#define mVUquickSearch(dest, src, size) ((((mVUCall)((void*)mVUsearchXMM))(dest, src)) == 0xf)
// Note: If GCC builds crash with above function, it means
// that they're not guaranteeing 16-byte alignment on the structs
// being compared. So use this function instead:
#define mVUemitSearch() { mVUcustomSearch(); }
#else
//#define mVUquickSearch(dest, src, size) (!memcmp(dest, src, size))
// Note: GCC builds crash with custom search function, because
// they're not guaranteeing 16-byte alignment on the structs :(
// #define mVUquickSearch(dest, src, size) (!memcmp(dest, src, size))
#define mVUquickSearch(dest, src, size) (!memcmp_mmx(dest, src, size))
#define mVUemitSearch()
#define mVUemitSearch()
#endif
// Misc Macros...

View File

@ -438,11 +438,11 @@ void SSE_ADD2PS_XMM_to_XMM(x86SSERegType to, x86SSERegType from) {
// Micro VU - Custom Quick Search
//------------------------------------------------------------------
#ifndef __LINUX__
PCSX2_ALIGNED(0x1000, static u8 mVUsearchXMM[0x1000]);
// Generates a custom optimized block-search function (Note: Structs must be 16-byte aligned!)
void mVUemitSearch() {
// Generates a custom optimized block-search function
// Note: Structs must be 16-byte aligned! (GCC doesn't guarantee this)
void mVUcustomSearch() {
using namespace x86Emitter;
HostSys::MemProtect(mVUsearchXMM, 0x1000, Protect_ReadWrite, false);
memset_8<0xcc,0x1000>(mVUsearchXMM);
@ -491,4 +491,3 @@ void mVUemitSearch() {
xRET();
HostSys::MemProtect(mVUsearchXMM, 0x1000, Protect_ReadOnly, true );
}
#endif