From 6fdfdf604fc286b44346897d4dc9d8cd63c0b59a Mon Sep 17 00:00:00 2001 From: refraction Date: Sat, 17 Jul 2010 13:53:09 +0000 Subject: [PATCH] vifUnpack: Made V3_## Unpacks work the same as V4_32, this is how legacy did it to, for some reason i made it copy the 3rd vector in to the fourth >.< git-svn-id: http://pcsx2.googlecode.com/svn/trunk@3516 96395faa-99c1-11dd-bbfe-3dabce05a288 --- pcsx2/x86/newVif_UnpackSSE.cpp | 155 ++++++++++++++++++--------------- 1 file changed, 84 insertions(+), 71 deletions(-) diff --git a/pcsx2/x86/newVif_UnpackSSE.cpp b/pcsx2/x86/newVif_UnpackSSE.cpp index 7e089b9e7b..32cc3c1f0a 100644 --- a/pcsx2/x86/newVif_UnpackSSE.cpp +++ b/pcsx2/x86/newVif_UnpackSSE.cpp @@ -98,27 +98,31 @@ void VifUnpackSSE_Base::xUPK_S_32() const { } void VifUnpackSSE_Base::xUPK_S_16() const { -if (x86caps.hasStreamingSIMD4Extensions) { - xPMOVXX16 (workReg); -} -else { - xMOV16 (workReg, ptr32[srcIndirect]); - xPUNPCK.LWD(workReg, workReg); - xShiftR (workReg, 16); -} + if (x86caps.hasStreamingSIMD4Extensions) + { + xPMOVXX16 (workReg); + } + else + { + xMOV16 (workReg, ptr32[srcIndirect]); + xPUNPCK.LWD(workReg, workReg); + xShiftR (workReg, 16); + } xPSHUF.D (destReg, workReg, _v0); } void VifUnpackSSE_Base::xUPK_S_8() const { -if (x86caps.hasStreamingSIMD4Extensions) { - xPMOVXX8 (workReg); -} -else { - xMOV8 (workReg, ptr32[srcIndirect]); - xPUNPCK.LBW(workReg, workReg); - xPUNPCK.LWD(workReg, workReg); - xShiftR (workReg, 24); -} + if (x86caps.hasStreamingSIMD4Extensions) + { + xPMOVXX8 (workReg); + } + else + { + xMOV8 (workReg, ptr32[srcIndirect]); + xPUNPCK.LBW(workReg, workReg); + xPUNPCK.LWD(workReg, workReg); + xShiftR (workReg, 24); + } xPSHUF.D (destReg, workReg, _v0); } @@ -133,58 +137,63 @@ void VifUnpackSSE_Base::xUPK_V2_32() const { } void VifUnpackSSE_Base::xUPK_V2_16() const { -if (x86caps.hasStreamingSIMD4Extensions) { - xPMOVXX16 (destReg); -} -else { - xMOV32 (destReg, ptr32[srcIndirect]); - xPUNPCK.LWD(destReg, destReg); - xShiftR (destReg, 16); -} + if (x86caps.hasStreamingSIMD4Extensions) + { + xPMOVXX16 (destReg); + } + else + { + xMOV32 (destReg, ptr32[srcIndirect]); + xPUNPCK.LWD(destReg, destReg); + xShiftR (destReg, 16); + } xPSHUF.D (destReg, destReg, 0x44); //v1v0v1v0 } void VifUnpackSSE_Base::xUPK_V2_8() const { -if (x86caps.hasStreamingSIMD4Extensions) { - xPMOVXX8 (destReg); -} -else { - xMOV16 (destReg, ptr32[srcIndirect]); - xPUNPCK.LBW(destReg, destReg); - xPUNPCK.LWD(destReg, destReg); - xShiftR (destReg, 24); -} + if (x86caps.hasStreamingSIMD4Extensions) + { + xPMOVXX8 (destReg); + } + else + { + xMOV16 (destReg, ptr32[srcIndirect]); + xPUNPCK.LBW(destReg, destReg); + xPUNPCK.LWD(destReg, destReg); + xShiftR (destReg, 24); + } xPSHUF.D (destReg, destReg, 0x44); //v1v0v1v0 } void VifUnpackSSE_Base::xUPK_V3_32() const { xMOV128 (destReg, ptr32[srcIndirect]); - xPSHUF.D (destReg, destReg, 0xA4); //v2v2v1v0 } void VifUnpackSSE_Base::xUPK_V3_16() const { -if (x86caps.hasStreamingSIMD4Extensions) { - xPMOVXX16 (destReg); -} -else { - xMOV64 (destReg, ptr32[srcIndirect]); - xPUNPCK.LWD(destReg, destReg); - xShiftR (destReg, 16); -} - xPSHUF.D (destReg, destReg, 0xA4); //v2v2v1v0 + if (x86caps.hasStreamingSIMD4Extensions) + { + xPMOVXX16 (destReg); + } + else + { + xMOV64 (destReg, ptr32[srcIndirect]); + xPUNPCK.LWD(destReg, destReg); + xShiftR (destReg, 16); + } } void VifUnpackSSE_Base::xUPK_V3_8() const { -if (x86caps.hasStreamingSIMD4Extensions) { - xPMOVXX8 (destReg); -} -else { - xMOV32 (destReg, ptr32[srcIndirect]); - xPUNPCK.LBW(destReg, destReg); - xPUNPCK.LWD(destReg, destReg); - xShiftR (destReg, 24); -} - xPSHUF.D (destReg, destReg, 0xA4); //v2v2v1v0 + if (x86caps.hasStreamingSIMD4Extensions) + { + xPMOVXX8 (destReg); + } + else + { + xMOV32 (destReg, ptr32[srcIndirect]); + xPUNPCK.LBW(destReg, destReg); + xPUNPCK.LWD(destReg, destReg); + xShiftR (destReg, 24); + } } void VifUnpackSSE_Base::xUPK_V4_32() const { @@ -192,26 +201,30 @@ void VifUnpackSSE_Base::xUPK_V4_32() const { } void VifUnpackSSE_Base::xUPK_V4_16() const { -if (x86caps.hasStreamingSIMD4Extensions) { - xPMOVXX16 (destReg); -} -else { - xMOV64 (destReg, ptr32[srcIndirect]); - xPUNPCK.LWD(destReg, destReg); - xShiftR (destReg, 16); -} + if (x86caps.hasStreamingSIMD4Extensions) + { + xPMOVXX16 (destReg); + } + else + { + xMOV64 (destReg, ptr32[srcIndirect]); + xPUNPCK.LWD(destReg, destReg); + xShiftR (destReg, 16); + } } void VifUnpackSSE_Base::xUPK_V4_8() const { -if (x86caps.hasStreamingSIMD4Extensions) { - xPMOVXX8 (destReg); -} -else { - xMOV32 (destReg, ptr32[srcIndirect]); - xPUNPCK.LBW(destReg, destReg); - xPUNPCK.LWD(destReg, destReg); - xShiftR (destReg, 24); -} + if (x86caps.hasStreamingSIMD4Extensions) + { + xPMOVXX8 (destReg); + } + else + { + xMOV32 (destReg, ptr32[srcIndirect]); + xPUNPCK.LBW(destReg, destReg); + xPUNPCK.LWD(destReg, destReg); + xShiftR (destReg, 24); + } } void VifUnpackSSE_Base::xUPK_V4_5() const {