Bug 1690492 Comment 0 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

See https://github.com/WebAssembly/simd/issues/192#issuecomment-586397568.  If we know the control vector is a mask with all 0 or all 1 per lane (ie it comes from a friendly constant or from an operation we know to generate a mask) we should be able to use PBLENDVB to merge the vectors rather than PAND; PANDN; and POR as now, and we can also avoid a move and a scratch register. 

Using PBLENDVB is a little awkward because the control vector must be in xmm0, this isn't much of a hardship for Ion but might be a little messier in baseline.  We could make this an ion-only optimization.  This makes sense anyway since ion is required to optimize that the input is a mask in the case of a compare source.

The current code is actually pretty good so if we end up with anything more than just the single PBLENDVB it's probably not worth doing this.
See https://github.com/WebAssembly/simd/issues/192#issuecomment-586397568.  If we know the control vector is a mask with all 0 or all 1 per lane (ie it comes from a friendly constant or from an operation we know to generate a mask) we should be able to use PBLENDVB to merge the vectors rather than PAND; PANDN; and POR as now, and we can also avoid a move and a scratch register. 

Using PBLENDVB is a little awkward because the control vector must be in xmm0, this isn't much of a hardship for Ion but might be a little messier in baseline.  We could make this an ion-only optimization.  This makes sense anyway since ion is required to recognize that the input is a mask in the case of a compare source.

The current code is actually pretty good so if we end up with anything more than just the single PBLENDVB it's probably not worth doing this.

Back to Bug 1690492 Comment 0