ChakraCore icon indicating copy to clipboard operation
ChakraCore copied to clipboard

WASM SIMD - Single instruction shuffle

Open ppenzin opened this issue 5 years ago • 2 comments

Current implementation of wasm SIMD shuffle produces a scalar loop over the bytes of the vector. That is the leftover of the situation when there were multiple shuffles with different lane shuffles - byte shuffle was considered lower priority than other kinds.

To solve this Chakra would need to emit byteshuffle instructions (pshufb on x86).

ppenzin avatar Mar 31 '20 03:03 ppenzin

Extra credit - detect shuffle masks that would be able to lower to hardware instructions other than shuffle bytes, but getting rid of the scalar loop would be already significant.

ppenzin avatar Apr 01 '20 07:04 ppenzin

There is one case when detecting mask which would pretty straight-forward to implement: cases when opcodes normally resulting in Simd128LowerShuffle by Simd128LowerShuffle_4.

ppenzin avatar Apr 22 '20 02:04 ppenzin