From 34a196376bbb9b3d497e6b78af89ed121fe0dad1 Mon Sep 17 00:00:00 2001 From: cottonvibes Date: Thu, 2 Oct 2008 12:20:58 +0000 Subject: [PATCH] made the code i commented-out in r167 work correctly. games that had problems when the "disable underflow" speedhack was left Un-Checked, should now be fixed. git-svn-id: http://pcsx2-playground.googlecode.com/svn/trunk@169 a6443dda-0b58-4228-96e9-037be469359c --- pcsx2/x86/iVUmicro.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/pcsx2/x86/iVUmicro.c b/pcsx2/x86/iVUmicro.c index db842826e3..e7a2bcb74d 100644 --- a/pcsx2/x86/iVUmicro.c +++ b/pcsx2/x86/iVUmicro.c @@ -1478,13 +1478,11 @@ void recUpdateFlags(VURegs * VU, int reg, int info) //-------------------------Optional Code: Denormals Are Zero------------------------------ if (CHECK_UNDERFLOW) { // Sets underflow/denormals to zero - /* - SSE_ANDNPS_XMM_to_XMM(t1reg, reg); // t1reg = !t1reg & reg + SSE_ANDNPS_XMM_to_XMM(t1reg, reg); // t1reg = !t1reg & reg (t1reg = denormals are positive zero) + VU_MERGE_REGS_CUSTOM(t1reg, reg, (15 - flipMask[_X_Y_Z_W])); // Send t1reg the vectors that shouldn't be modified (since reg was flipped, we need a mask to get the unmodified vectors) // Now we have Denormals are Positive Zero in t1reg; the next two lines take Signed Zero into account - SSE_ANDPS_M128_to_XMM(reg, (uptr)&VU_Signed_Zero_Mask[ 0 ]); - SSE_ORPS_XMM_to_XMM(reg, t1reg); - */ - // ToDO: Make it so that we only set modified vectors to zero! (the current code sets denormals to zero even if the vector isn't used in the calculation) + SSE_ANDPS_M128_to_XMM(reg, (uptr)&VU_Signed_Zero_Mask[ 0 ]); // Only keep the sign bit for each vector + SSE_ORPS_XMM_to_XMM(reg, t1reg); // Denormals are Signed Zero, and unmodified vectors stay the same! } x86SetJ32(pjmp32); // If we skipped the Underflow Flag Checking (when we had an Overflow), return here