Hasty Briefsbeta

Bilingual

Safe SIMD in Rust, Even on the Inside – By Sergey "Shnatsel" Davidoff

5 hours ago
  • #Performance
  • #SIMD
  • #Rust
  • Rust's SIMD abstractions were improved to reduce unsafe code usage.
  • A new method uses CPU feature tokens (zero-sized types) to ensure safe SIMD intrinsic calls.
  • Generics allow SIMD operations like a + b to automatically use the best available instruction set.
  • Inlining and #[target_feature] annotations help maintain performance but require careful function annotation.
  • The fearless_simd crate (v0.5) implements these ideas, offering a safer and more pleasant SIMD API.