newVif bug fixes (mostly related to the interpreted version), and switched it back off again. >_<

git-svn-id: http://pcsx2.googlecode.com/svn/trunk@2392 96395faa-99c1-11dd-bbfe-3dabce05a288
This commit is contained in:
Jake.Stine 2009-12-24 02:30:05 +00:00
parent c2aa78f2b5
commit af66887d0c
6 changed files with 21 additions and 16 deletions

View File

@ -58,7 +58,7 @@ __forceinline void vif1FLUSH()
void vif1Init()
{
#ifdef newVif1
#if newVif1
extern void initNewVif(int idx);
initNewVif(1);
#endif
@ -320,8 +320,9 @@ static int __fastcall Vif1TransDirectHL(u32 *data)
}
static int __fastcall Vif1TransUnpack(u32 *data)
{
if( newVif1 )
return nVifUnpack(1, (u8*)data);
#if newVif1
return nVifUnpack(1, (u8*)data);
#endif
XMMRegisters::Freeze();

View File

@ -413,7 +413,7 @@ template<const u32 VIFdmanum> u32 VIFalign(u32 *data, vifCode *v, u32 size)
return size>>2;
}
#include "newVif.h"
#ifndef newVif
#if !newVif
template void VIFunpack<0>(u32 *data, vifCode *v, u32 size);
template void VIFunpack<1>(u32 *data, vifCode *v, u32 size);
template<const u32 VIFdmanum> void VIFunpack(u32 *data, vifCode *v, u32 size)
@ -738,7 +738,7 @@ template<const u32 VIFdmanum> void VIFunpack(u32 *data, vifCode *v, u32 size)
}
}
}
#endif // #ifndef newVif
#endif // #if !newVif
template void vuExecMicro<0>(u32 addr);
template void vuExecMicro<1>(u32 addr);

View File

@ -85,8 +85,8 @@ static __forceinline u32 vif_size(u8 num)
// All defines are enabled with '1' or disabled with '0'
#define newVif 1 // Enable 'newVif' Code (if the below macros are not defined, it will use old non-sse code)
#define newVif1 1 // Use New Code for Vif1 Unpacks (needs newVif defined)
#define newVif 0 // Enable 'newVif' Code (if the below macros are not defined, it will use old non-sse code)
#define newVif1 0 // Use New Code for Vif1 Unpacks (needs newVif defined)
#define newVif0 0 // Use New Code for Vif0 Unpacks (not implemented)
#if newVif

View File

@ -36,8 +36,8 @@ VifUnpackSSE_Base::VifUnpackSSE_Base()
}
void VifUnpackSSE_Base::xMovDest(const xRegisterSSE& srcReg) const {
if (!doMode && !doMask) { xMOVAPS (ptr[dstIndirect], srcReg); }
else { doMaskWrite(srcReg); }
if (IsUnmaskedOp()) { xMOVAPS (ptr[dstIndirect], srcReg); }
else { doMaskWrite(srcReg); }
}
void VifUnpackSSE_Base::xShiftR(const xRegisterSSE& regX, int n) const {
@ -197,7 +197,7 @@ void VifUnpackSSE_Base::xUPK_V4_5() const {
xMovDest (xmm1);
}
void VifUnpackSSE_Base::xUnpack( int upknum )
void VifUnpackSSE_Base::xUnpack( int upknum ) const
{
switch( upknum )
{
@ -252,13 +252,12 @@ static void nVifGen(int usn, int mask, int curCycle) {
int usnpart = usn*2*16;
int maskpart = mask*16;
int curpart = curCycle;
VifUnpackSSE_Simple vpugen( !!usn, !!mask, curCycle );
for( int i=0; i<16; ++i )
{
nVifCall& ucall( nVifUpk[((usnpart+maskpart+i) * 4) + (curpart)] );
nVifCall& ucall( nVifUpk[((usnpart+maskpart+i) * 4) + curCycle] );
ucall = NULL;
if( nVifT[i] == 0 ) continue;

View File

@ -34,7 +34,6 @@ class VifUnpackSSE_Base
public:
bool usn; // unsigned flag
bool doMask; // masking write enable flag
int doMode; // two bit value representing... something!
protected:
xAddressInfo dstIndirect;
@ -44,7 +43,8 @@ public:
VifUnpackSSE_Base();
virtual ~VifUnpackSSE_Base() throw() {}
void xUnpack( int upktype );
virtual void xUnpack( int upktype ) const;
virtual bool IsUnmaskedOp() const=0;
protected:
virtual void doMaskWrite(const xRegisterSSE& regX ) const=0;
@ -87,6 +87,8 @@ public:
VifUnpackSSE_Simple(bool usn_, bool domask_, int curCycle_);
virtual ~VifUnpackSSE_Simple() throw() {}
virtual bool IsUnmaskedOp() const{ return !doMask; }
protected:
virtual void doMaskWrite(const xRegisterSSE& regX ) const;
};
@ -100,6 +102,7 @@ class VifUnpackSSE_Dynarec : public VifUnpackSSE_Base
public:
bool isFill;
int doMode; // two bit value representing... something!
protected:
const nVifStruct& v; // vif0 or vif1
@ -119,6 +122,8 @@ public:
virtual ~VifUnpackSSE_Dynarec() throw() {}
virtual bool IsUnmaskedOp() const{ return !doMode && !doMask; }
void CompileRoutine();
protected:

View File

@ -99,7 +99,7 @@ extern __aligned16 const u8 nVifT[32];
extern __aligned16 nVifCall nVifUpk[(2*2*16) *4]; // ([USN][Masking][Unpack Type]) [curCycle]
extern __aligned16 u32 nVifMask[3][4][4]; // [MaskNumber][CycleNumber][Vector]
static const bool useOldUnpack = false; // Use code in newVif_OldUnpack.inl
static const bool newVifDynaRec = true; // Use code in newVif_Dynarec.inl
static const bool useOldUnpack = false; // Use code in newVif_OldUnpack.inl
static const bool newVifDynaRec = true; // Use code in newVif_Dynarec.inl
#endif