From 9706484850ecd616c95e14d3accd2f9c2af90637 Mon Sep 17 00:00:00 2001 From: LegendOfDragoon Date: Sun, 1 Mar 2015 03:31:57 -0800 Subject: [PATCH] Small optimization to VADD --- 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 4f7e46a5c..87d29d448 100644 --- a/Source/RSP/Recompiler Ops.c +++ b/Source/RSP/Recompiler Ops.c @@ -3129,10 +3129,15 @@ BOOL Compile_Vector_VADD_MMX ( void ) { MmxPaddswRegToReg(x86_MM0, x86_MM2); MmxPaddswRegToReg(x86_MM1, x86_MM2); } else if ((RSPOpC.rs & 15) < 2) { - sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.rt); - MmxPaddswVariableToReg(x86_MM0, &RSP_Vect[RSPOpC.rt].HW[0], Reg); - sprintf(Reg, "RSP_Vect[%i].HW[4]", RSPOpC.rt); - MmxPaddswVariableToReg(x86_MM1, &RSP_Vect[RSPOpC.rt].HW[4], Reg); + if (RSPOpC.rd == RSPOpC.rt){ + MmxPaddswRegToReg(x86_MM0, x86_MM0); + MmxPaddswRegToReg(x86_MM1, x86_MM1); + } else{ + sprintf(Reg, "RSP_Vect[%i].HW[0]", RSPOpC.rt); + MmxPaddswVariableToReg(x86_MM0, &RSP_Vect[RSPOpC.rt].HW[0], Reg); + sprintf(Reg, "RSP_Vect[%i].HW[4]", RSPOpC.rt); + MmxPaddswVariableToReg(x86_MM1, &RSP_Vect[RSPOpC.rt].HW[4], Reg); + } } else { RSP_MultiElement2Mmx(x86_MM2, x86_MM3); MmxPaddswRegToReg(x86_MM0, x86_MM2);