From fa4fcc9d93234960095cf6b29126d8d8b377fa01 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Sun, 1 Mar 2015 03:07:16 -0800 Subject: [PATCH] Small optimization to VMULF --- Source/RSP/Recompiler Ops.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Source/RSP/Recompiler Ops.c b/Source/RSP/Recompiler Ops.c index 6b810a9e4..2e4fbb425 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -1990,10 +1990,15 @@ BOOL Compile_Vector_VMULF_MMX ( void ) { MmxMoveQwordVariableToReg(x86_MM1, &RSP_Vect[RSPOpC.rd].UHW[4], Reg); if ((RSPOpC.rs & 0xF) < 2) { - sprintf(Reg, "RSP_Vect[%i].UHW[0]", RSPOpC.rt); - MmxPmulhwRegToVariable(x86_MM0, &RSP_Vect[RSPOpC.rt].UHW[0], Reg); - sprintf(Reg, "RSP_Vect[%i].UHW[4]", RSPOpC.rt); - MmxPmulhwRegToVariable(x86_MM1, &RSP_Vect[RSPOpC.rt].UHW[4], Reg); + if (RSPOpC.rd == RSPOpC.rt){ + MmxPmulhwRegToReg(x86_MM0, x86_MM0); + MmxPmulhwRegToReg(x86_MM1, x86_MM1); + } else { + sprintf(Reg, "RSP_Vect[%i].UHW[0]", RSPOpC.rt); + MmxPmulhwRegToVariable(x86_MM0, &RSP_Vect[RSPOpC.rt].UHW[0], Reg); + sprintf(Reg, "RSP_Vect[%i].UHW[4]", RSPOpC.rt); + MmxPmulhwRegToVariable(x86_MM1, &RSP_Vect[RSPOpC.rt].UHW[4], Reg); + } } else if ((RSPOpC.rs & 0xF) >= 8) { RSP_Element2Mmx(x86_MM2); MmxPmulhwRegToReg(x86_MM0, x86_MM2);