From f7a8dc37485d9627004215cc3e97828ed649fb1e Mon Sep 17 00:00:00 2001 From: "Dr. Chat" Date: Sat, 23 May 2015 17:27:26 -0500 Subject: [PATCH] Change OPCODE_SPLAT instructions from SSE->AVX --- src/xenia/cpu/backend/x64/x64_sequences.cc | 24 ++++++++++------------ 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/src/xenia/cpu/backend/x64/x64_sequences.cc b/src/xenia/cpu/backend/x64/x64_sequences.cc index 60410d248..194da6792 100644 --- a/src/xenia/cpu/backend/x64/x64_sequences.cc +++ b/src/xenia/cpu/backend/x64/x64_sequences.cc @@ -5551,15 +5551,14 @@ EMITTER(SPLAT_I8, MATCH(I, I8<>>)) { } else { if (i.src1.is_constant) { e.mov(e.eax, i.src1.constant()); - e.movd(e.xmm0, e.eax); + e.vmovd(e.xmm0, e.eax); } else { - e.movd(e.xmm0, i.src1.reg().cvt32()); + e.vmovd(e.xmm0, i.src1.reg().cvt32()); } - // Credits: VC++ compiler (i love you so much) - e.punpcklbw(e.xmm0, e.xmm0); - e.punpcklwd(e.xmm0, e.xmm0); - e.pshufd(i.dest, e.xmm0, 0); + e.vpunpcklbw(e.xmm0, e.xmm0); + e.vpunpcklwd(e.xmm0, e.xmm0); + e.vpshufd(i.dest, e.xmm0, 0); } } }; @@ -5578,14 +5577,13 @@ EMITTER(SPLAT_I16, MATCH(I, I16<>>)) { } else { if (i.src1.is_constant) { e.mov(e.eax, i.src1.constant()); - e.movd(e.xmm0, e.eax); + e.vmovd(e.xmm0, e.eax); } else { - e.movd(e.xmm0, i.src1.reg().cvt32()); + e.vmovd(e.xmm0, i.src1.reg().cvt32()); } - // Credits: VC++ compiler (i love you so much) - e.punpcklwd(e.xmm0, e.xmm0); // unpack low word data - e.pshufd(i.dest, e.xmm0, 0); + e.vpunpcklwd(e.xmm0, e.xmm0); // unpack low word data + e.vpshufd(i.dest, e.xmm0, 0); } } }; @@ -5609,7 +5607,7 @@ EMITTER(SPLAT_I32, MATCH(I, I32<>>)) { e.vmovd(e.xmm0, i.src1.reg().cvt32()); } - e.pshufd(i.dest, e.xmm0, 0); + e.vpshufd(i.dest, e.xmm0, 0); } } }; @@ -5632,7 +5630,7 @@ EMITTER(SPLAT_F32, MATCH(I, F32<>>)) { e.vmovd(i.dest, i.src1.reg().cvt32()); } - e.shufps(i.dest, i.dest, 0); + e.vshufps(i.dest, i.dest, i.dest, 0); } } };