Fixing permute.

This commit is contained in:
Ben Vanik 2014-05-27 07:53:19 -07:00
parent 5a85263e5f
commit efa0565398
1 changed files with 2 additions and 2 deletions

View File

@ -4028,8 +4028,6 @@ EMITTER(PERMUTE_V128, MATCH(I<OPCODE_PERMUTE, V128<>, V128<>, V128<>, V128<>>))
} else { } else {
e.vpshufb(e.xmm2, i.src1, e.GetXmmConstPtr(XMMByteSwapMask)); 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; Xmm src2_shuf = e.xmm0;
if (i.src2.value->IsConstantZero()) { if (i.src2.value->IsConstantZero()) {
e.vpxor(src2_shuf, src2_shuf); e.vpxor(src2_shuf, src2_shuf);
@ -4048,6 +4046,8 @@ EMITTER(PERMUTE_V128, MATCH(I<OPCODE_PERMUTE, V128<>, V128<>, V128<>, V128<>>))
} else { } else {
e.vpshufb(src3_shuf, i.src3, e.xmm2); 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); e.vpblendvb(i.dest, src2_shuf, src3_shuf, i.dest);
} }
} }