Bug 1690483 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.

The variable swizzle on intel can use PSHUFB to shuffle the bytes but the mask vector must first be sanitized so that out-of-range lanes in the mask have the high bit set.  Currently we use a compare-with-constant-and-POR to do this (and we don't even inline the constant load in the compare, sigh) but it's possible to do better by saturating-add'ing a constant into the mask: https://github.com/WebAssembly/simd/issues/68#issuecomment-470825324

For specific code generation, I'm not sure if it's better to (a) splat a byte value into scratch / load the constant into scratch, and add the mask to the scratch, or (b)  to move the mask to scratch and add a constant from memory into scratch.  Either way the mask register is not volatile.
The variable swizzle on intel can use PSHUFB to shuffle the bytes but the mask vector must first be sanitized so that out-of-range lanes in the mask have the high bit set.  Currently we use a compare-with-constant-and-POR to do this (and we don't even inline the constant load in the compare, sigh) but it's possible to do better by saturating-add'ing a constant into the mask: https://github.com/WebAssembly/simd/issues/68#issuecomment-470825324

For specific code generation, I'm not sure if it's better to (a) splat a byte value into scratch / load the constant into scratch, and add the mask to the scratch, or (b)  to move the mask to scratch and add a constant from memory into scratch.  Either way the mask register is not volatile.

Also see https://github.com/WebAssembly/simd/issues/93 for more discussion.
The variable swizzle on intel can use PSHUFB to shuffle the bytes but the mask vector must first be sanitized so that out-of-range lanes in the mask have the high bit set.  Currently we use a compare-with-constant-and-POR to do this (and we don't even inline the constant load in the compare, sigh) but it's possible to do better by saturating-add'ing a constant into the mask: https://github.com/WebAssembly/simd/issues/68#issuecomment-470825324

For specific code generation, I'm not sure if it's better to (a) splat a byte value into scratch / load the constant into scratch, and add the mask to the scratch, or (b)  to move the mask to scratch and add a constant from memory into scratch.  Either way the mask register is not volatile.

Also see https://github.com/WebAssembly/simd/issues/93 for more discussion, probably worth reading although it ranges across a bunch of topics.

Back to Bug 1690483 Comment 0