mirror of https://github.com/PCSX2/pcsx2.git
fixed a problem with VU CLIP, and optimized it a bit as well.
git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@50 a6443dda-0b58-4228-96e9-037be469359c
This commit is contained in:
parent
1407170be7
commit
e7c805635b
|
@ -3648,7 +3648,7 @@ void recVUMI_CLIP(VURegs *VU, int info)
|
||||||
{
|
{
|
||||||
int t1reg = EEREC_D;
|
int t1reg = EEREC_D;
|
||||||
int t2reg = EEREC_ACC;
|
int t2reg = EEREC_ACC;
|
||||||
int x86temp1, x86temp2;
|
int x86temp1;
|
||||||
|
|
||||||
u32 clipaddr = VU_VI_ADDR(REG_CLIP_FLAG, 0);
|
u32 clipaddr = VU_VI_ADDR(REG_CLIP_FLAG, 0);
|
||||||
u32 prevclipaddr = VU_VI_ADDR(REG_CLIP_FLAG, 2);
|
u32 prevclipaddr = VU_VI_ADDR(REG_CLIP_FLAG, 2);
|
||||||
|
@ -3662,9 +3662,8 @@ void recVUMI_CLIP(VURegs *VU, int info)
|
||||||
assert( t1reg != t2reg && t1reg != EEREC_TEMP && t2reg != EEREC_TEMP );
|
assert( t1reg != t2reg && t1reg != EEREC_TEMP && t2reg != EEREC_TEMP );
|
||||||
|
|
||||||
x86temp1 = ALLOCTEMPX86(MODE_8BITREG);
|
x86temp1 = ALLOCTEMPX86(MODE_8BITREG);
|
||||||
x86temp2 = ALLOCTEMPX86(MODE_8BITREG);
|
|
||||||
|
|
||||||
if ( (x86temp1 == 0) || (x86temp2 == 0) ) SysPrintf("VU CLIP Allocation Error: EAX being allocated!");
|
if (x86temp1 == 0) SysPrintf("VU CLIP Allocation Error: EAX being allocated!");
|
||||||
|
|
||||||
if( _Ft_ == 0 ) {
|
if( _Ft_ == 0 ) {
|
||||||
// all 1s
|
// all 1s
|
||||||
|
@ -3680,22 +3679,24 @@ void recVUMI_CLIP(VURegs *VU, int info)
|
||||||
|
|
||||||
MOV32MtoR(EAX, prevclipaddr);
|
MOV32MtoR(EAX, prevclipaddr);
|
||||||
|
|
||||||
SSE_CMPNLTPS_XMM_to_XMM(t1reg, EEREC_S); //-w, -z, -y, -x
|
SSE_CMPNLEPS_XMM_to_XMM(t1reg, EEREC_S); //-w, -z, -y, -x
|
||||||
SSE_CMPLEPS_XMM_to_XMM(EEREC_TEMP, EEREC_S); //+w, +z, +y, +x
|
SSE_CMPLTPS_XMM_to_XMM(EEREC_TEMP, EEREC_S); //+w, +z, +y, +x
|
||||||
|
|
||||||
SHL32ItoR(EAX, 6);
|
SHL32ItoR(EAX, 6);
|
||||||
|
|
||||||
SSE_MOVAPS_XMM_to_XMM(t2reg, EEREC_TEMP); //t2 = +w, +z, +y, +x
|
SSE_MOVAPS_XMM_to_XMM(t2reg, EEREC_TEMP); //t2 = +w, +z, +y, +x
|
||||||
SSE_UNPCKLPS_XMM_to_XMM(EEREC_TEMP, t1reg); //EEREC_TEMP = -y,+y,-x,+x
|
SSE_UNPCKLPS_XMM_to_XMM(EEREC_TEMP, t1reg); //EEREC_TEMP = -y,+y,-x,+x
|
||||||
SSE_UNPCKHPS_XMM_to_XMM(t2reg, t1reg); //t2reg = -w,+w,-z,+z
|
SSE_UNPCKHPS_XMM_to_XMM(t2reg, t1reg); //t2reg = -w,+w,-z,+z
|
||||||
SSE_MOVMSKPS_XMM_to_R32(x86temp2, EEREC_TEMP); // -y,+y,-x,+x
|
|
||||||
SSE_MOVMSKPS_XMM_to_R32(x86temp1, t2reg); // -w,+w,-z,+z
|
SSE_MOVMSKPS_XMM_to_R32(x86temp1, t2reg); // -w,+w,-z,+z
|
||||||
|
|
||||||
AND8ItoR(x86temp1, 0x3);
|
AND8ItoR(x86temp1, 0x3);
|
||||||
SHL8ItoR(x86temp1, 4);
|
SHL8ItoR(x86temp1, 4);
|
||||||
OR8RtoR(EAX, x86temp1);
|
OR8RtoR(EAX, x86temp1);
|
||||||
AND8ItoR(x86temp2, 0xf);
|
|
||||||
OR8RtoR(EAX, x86temp2);
|
SSE_MOVMSKPS_XMM_to_R32(x86temp1, EEREC_TEMP); // -y,+y,-x,+x
|
||||||
|
|
||||||
|
AND8ItoR(x86temp1, 0xf);
|
||||||
|
OR8RtoR(EAX, x86temp1);
|
||||||
AND32ItoR(EAX, 0xffffff);
|
AND32ItoR(EAX, 0xffffff);
|
||||||
|
|
||||||
MOV32RtoM(clipaddr, EAX);
|
MOV32RtoM(clipaddr, EAX);
|
||||||
|
@ -3706,7 +3707,6 @@ void recVUMI_CLIP(VURegs *VU, int info)
|
||||||
//_freeXMMreg(t2reg);
|
//_freeXMMreg(t2reg);
|
||||||
|
|
||||||
_freeX86reg(x86temp1);
|
_freeX86reg(x86temp1);
|
||||||
_freeX86reg(x86temp2);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/******************************/
|
/******************************/
|
||||||
|
|
Loading…
Reference in New Issue