From bcefa880e4d062121df9ab8b831170ec3a689a50 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Wed, 20 Nov 2013 21:30:49 +0100 Subject: [PATCH] Jit64: fix fmrx regression Revision ddaf29e039d1736be1ca48c1c0b6af1c8d4ec47d introduced a register corruption bug (#6825). Since fmrx/MOVSD only modifies ps0 but we save both ps0 and ps1 in one xmm register, not loading the previous value when binding to a x64 register trashed ps1. But hey, a good opportunity to shave off one more instruction ;) --- .../Core/Core/Src/PowerPC/Jit64/Jit_FloatingPoint.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/Core/Core/Src/PowerPC/Jit64/Jit_FloatingPoint.cpp b/Source/Core/Core/Src/PowerPC/Jit64/Jit_FloatingPoint.cpp index b0d0ab4853..65f186e802 100644 --- a/Source/Core/Core/Src/PowerPC/Jit64/Jit_FloatingPoint.cpp +++ b/Source/Core/Core/Src/PowerPC/Jit64/Jit_FloatingPoint.cpp @@ -229,11 +229,12 @@ void Jit64::fmrx(UGeckoInstruction inst) } int d = inst.FD; int b = inst.FB; - fpr.Lock(b, d); - fpr.BindToRegister(d, d == b, true); - MOVSD(XMM0, fpr.R(b)); - MOVSD(fpr.R(d), XMM0); - fpr.UnlockAll(); + if (d != b) { + fpr.Lock(b, d); + fpr.BindToRegister(d); + MOVSD(fpr.RX(d), fpr.R(b)); + fpr.UnlockAll(); + } } void Jit64::fcmpx(UGeckoInstruction inst)