From 2cf27e4de8dd7c816a5c885ab1e13d6dea9052d3 Mon Sep 17 00:00:00 2001 From: Tillmann Karras Date: Mon, 2 Jun 2014 08:53:02 +0200 Subject: [PATCH] Jit64: revert fmrx revert The AVX revert was not supposed to touch fmrx. Partially reverts 2fad2a3e88c5fbd76d897fcfed362233d3936d12. --- .../Core/PowerPC/Jit64/Jit_FloatingPoint.cpp | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp b/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp index b5cd8833a6..0d13c19efe 100644 --- a/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp +++ b/Source/Core/Core/PowerPC/Jit64/Jit_FloatingPoint.cpp @@ -211,10 +211,21 @@ void Jit64::fmrx(UGeckoInstruction inst) int d = inst.FD; int b = inst.FB; + + if (d == b) + return; + fpr.Lock(b, d); - fpr.BindToRegister(d, true, true); - MOVSD(XMM0, fpr.R(b)); - MOVSD(fpr.R(d), XMM0); + + // We don't need to load d, but if it is loaded, we need to mark it as dirty. + if (fpr.IsBound(d)) + fpr.BindToRegister(d); + + // b needs to be in a register because "MOVSD reg, mem" sets the upper bits (64+) to zero and we don't want that. + fpr.BindToRegister(b, true, false); + + MOVSD(fpr.R(d), fpr.RX(b)); + fpr.UnlockAll(); }