From 1baa8ee970c726da1aeb6a1c01f955fe28f79e57 Mon Sep 17 00:00:00 2001 From: MerryMage Date: Sat, 27 Apr 2019 12:56:05 +0100 Subject: [PATCH] x64Emitter: Prefer MOVAPS to MOVSD * The high half of regOp is immediately overwritten so the value in it is irrelevant. * MOVSD produces an unnecessary dependency on the high half of regOp. * MOVAPS is implemented as a register rename on modern microarchitectures. --- Source/Core/Common/x64Emitter.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/Source/Core/Common/x64Emitter.cpp b/Source/Core/Common/x64Emitter.cpp index 19a982d1c2..42258d1a84 100644 --- a/Source/Core/Common/x64Emitter.cpp +++ b/Source/Core/Common/x64Emitter.cpp @@ -2429,8 +2429,14 @@ void XEmitter::MOVDDUP(X64Reg regOp, const OpArg& arg) } else { - if (!arg.IsSimpleReg(regOp)) + if (!arg.IsSimpleReg()) + { MOVSD(regOp, arg); + } + else if (regOp != arg.GetSimpleReg()) + { + MOVAPD(regOp, arg); + } UNPCKLPD(regOp, R(regOp)); } }