Skip to main content

Crate simd

Crate simd 

Source

Structs§

Avx2
Portable pair of 128-bit lanes, useful for AVX2-equivalent conformance tests.
Neon128
NEON: 128-bit registers (the ARM64 baseline)
Scalar
Portable 128-bit register backend, the first WebAssembly baseline.
Scalar256
Portable pair of 128-bit lanes, useful for AVX2-equivalent conformance tests.
Sse2
NEON: 128-bit registers (the ARM64 baseline)

Constants§

CPU_AVX2
Native AVX2 capability bit; never advertised by the scalar browser backend.

Traits§

Kernel
a computation written once for every instruction set
Simd
operations of one register type; integer lanes are named by their width (8 / 16 / 32), signed operations end in s, unsigned in u

Functions§

copy_stream
copy_stream without streaming stores (other targets). ARM64 needs nothing of its own: stnp is only a hint and its loose ordering would want a barrier, while a copy like this one writes whole lines in a row, which ARM cores notice and then stop allocating in their caches.
dispatch
Run a kernel with NEON on ARM64, with SIMD128 when enabled by the WASM bundle, otherwise scalar registers.
dispatch_sse2
run k with SSE2 (the baseline; tests compare it with dispatch)
has_avx2
AVX2 kernels may be used (CPU and OS support, not disabled by --simd sse2)
stream_fence
the streaming stores of this thread become visible to others (sfence); nothing to do on other targets: without such stores the release of whatever hands dst on is enough