Rust’s SIMD abstractions were not as safe as I’d like. Until now.

It’s no secret that raw SIMD intrinsics are unpleasant to use.

You want to write a + b, not this monstrosity:

unsafe {
    #[cfg(all(any(target_arch = "x86", target_arch = "x86_64"), target_feature = "avx2"))]
    _mm256_add_ps(a, b)
    #[cfg(all(any(target_arch = "x86", target_arch = "x86_64"), target_feature = "sse", not(target_feature = "avx2")))]
    _mm_add_ps(a, b)
    #[cfg(all(target_arch = "aarch64", target_feature = "neon"))]
    vaddq_f32(a, b)
}

Look at it. It’s hideous. And the whole thing is wrapped in unsafe!