From bfbd0443fe705dd0c5eb5cb6dcb66852f20f4cb0 Mon Sep 17 00:00:00 2001 From: Ville Linde Date: Thu, 14 Apr 2016 19:44:23 +0300 Subject: [PATCH] drcbex64: optimize FMOV (nw) --- src/devices/cpu/drcbex64.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/src/devices/cpu/drcbex64.cpp b/src/devices/cpu/drcbex64.cpp index 3a5b51b18bd..898cc8173bc 100644 --- a/src/devices/cpu/drcbex64.cpp +++ b/src/devices/cpu/drcbex64.cpp @@ -5952,15 +5952,29 @@ void drcbe_x64::op_fmov(x86code *&dst, const instruction &inst) // 32-bit form if (inst.size() == 4) { - emit_movss_r128_p32(dst, dstreg, srcp); // movss dstreg,srcp - emit_movss_p32_r128(dst, dstp, dstreg); // movss dstp,dstreg + if (srcp.is_float_register()) + { + emit_movss_p32_r128(dst, dstp, srcp.ireg()); // movss dstp,srcp + } + else + { + emit_movss_r128_p32(dst, dstreg, srcp); // movss dstreg,srcp + emit_movss_p32_r128(dst, dstp, dstreg); // movss dstp,dstreg + } } // 64-bit form else if (inst.size() == 8) { - emit_movsd_r128_p64(dst, dstreg, srcp); // movsd dstreg,srcp - emit_movsd_p64_r128(dst, dstp, dstreg); // movsd dstp,dstreg + if (srcp.is_float_register()) + { + emit_movsd_p64_r128(dst, dstp, srcp.ireg()); // movsd dstp,srcp + } + else + { + emit_movsd_r128_p64(dst, dstreg, srcp); // movsd dstreg,srcp + emit_movsd_p64_r128(dst, dstp, dstreg); // movsd dstp,dstreg + } } // resolve the jump