News for hackers. Stuff that matters.
Re:Custom Allocators in Rust by anonymoushn on Saturday April 08, 2023 @10:53AM (#35493758)
In this case it would be nice if operations that are type-safe and don't read or write memory at all, such as mm256_shuffle_epi8, were available in safe rust.
Re:Custom Allocators in Rust by jsheard on Saturday April 08, 2023 @11:10AM (#35493971)
It's a work in progress, on nightly there is a safe and portable SIMD abstraction under development in std::simd.

e.g. "mm256_shuffle_epi8" on X64+AVX2, ARM64+NEON and plain ARM: https://rust.godbolt.org/z/7rjKE93Kn

Re:Custom Allocators in Rust by anonymoushn on Saturday April 08, 2023 @07:06PM (#35498506)
This is helpful for the use cases that want to rearrange bytes in a fixed pattern, but it cannot yet express a stream vbyte decoder (out = pshufb(in, shuffle_patterns[len_mask])) or a check for which bytes are in small set of bytes with distinct lower nibbles and the high bit not set (eq(in, pshufb(set, in))) yet.

If it's to be portable it needs an extra instruction on one platform or the other because tbl and vpshufb do different things.