From 4436616e6d14f142ea9540ee8611504b727a94f2 Mon Sep 17 00:00:00 2001 From: gibbed Date: Sun, 18 Nov 2018 08:17:04 -0600 Subject: [PATCH] [x64] Use constant a bit earlier in VECTOR_SHL_V128. --- src/xenia/cpu/backend/x64/x64_sequences.cc | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/xenia/cpu/backend/x64/x64_sequences.cc b/src/xenia/cpu/backend/x64/x64_sequences.cc index 001501b44..37ab6bdbd 100644 --- a/src/xenia/cpu/backend/x64/x64_sequences.cc +++ b/src/xenia/cpu/backend/x64/x64_sequences.cc @@ -5621,6 +5621,14 @@ struct VECTOR_SHL_V128 return _mm_load_si128(reinterpret_cast<__m128i*>(value)); } static void EmitInt16(X64Emitter& e, const EmitArgType& i) { + Xmm src1; + if (i.src1.is_constant) { + src1 = e.xmm2; + e.LoadConstantXmm(src1, i.src1.constant()); + } else { + src1 = i.src1; + } + if (i.src2.is_constant) { const auto& shamt = i.src2.constant(); bool all_same = true; @@ -5632,7 +5640,7 @@ struct VECTOR_SHL_V128 } if (all_same) { // Every count is the same, so we can use vpsllw. - e.vpsllw(i.dest, i.src1, shamt.u16[0] & 0xF); + e.vpsllw(i.dest, src1, shamt.u16[0] & 0xF); return; } } @@ -5640,14 +5648,6 @@ struct VECTOR_SHL_V128 // Shift 8 words in src1 by amount specified in src2. Xbyak::Label emu, end; - Xmm src1; - if (i.src1.is_constant) { - src1 = e.xmm2; - e.LoadConstantXmm(src1, i.src1.constant()); - } else { - src1 = i.src1; - } - // Only bother with this check if shift amt isn't constant. if (!i.src2.is_constant) { // See if the shift is equal first for a shortcut.