From efa056539892dc5c105c65ba26c6f8d3b6d13be9 Mon Sep 17 00:00:00 2001 From: Ben Vanik Date: Tue, 27 May 2014 07:53:19 -0700 Subject: [PATCH] Fixing permute. --- src/alloy/backend/x64/x64_sequences.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/alloy/backend/x64/x64_sequences.cc b/src/alloy/backend/x64/x64_sequences.cc index a48df3db5..2d02a2118 100644 --- a/src/alloy/backend/x64/x64_sequences.cc +++ b/src/alloy/backend/x64/x64_sequences.cc @@ -4028,8 +4028,6 @@ EMITTER(PERMUTE_V128, MATCH(I, V128<>, V128<>, V128<>>)) } else { e.vpshufb(e.xmm2, i.src1, e.GetXmmConstPtr(XMMByteSwapMask)); } - // Build a mask with values in src2 having 0 and values in src3 having 1. - e.vpcmpgtb(i.dest, e.xmm2, e.GetXmmConstPtr(XMMPermuteControl15)); Xmm src2_shuf = e.xmm0; if (i.src2.value->IsConstantZero()) { e.vpxor(src2_shuf, src2_shuf); @@ -4048,6 +4046,8 @@ EMITTER(PERMUTE_V128, MATCH(I, V128<>, V128<>, V128<>>)) } else { e.vpshufb(src3_shuf, i.src3, e.xmm2); } + // Build a mask with values in src2 having 0 and values in src3 having 1. + e.vpcmpgtb(i.dest, e.xmm2, e.GetXmmConstPtr(XMMPermuteControl15)); e.vpblendvb(i.dest, src2_shuf, src3_shuf, i.dest); } }