- 2018 Post and Current Status: 7 years ago, a blog post outlined Rust for SIMD. Currently, writing SIMD in Rust is rough but there has been progress. Linebender projects are now using SIMD for CPU/GPU hybrid rendering and other tasks.
- Simple Sigmoid Example: A scalar sigmoid function and its autovectorized version are shown. More complex examples often fail to autovectorize due to floating-point semantics.
- Safety Issue: Exposed SIMD intrinsics are marked as
unsafe
as SIMD support varies. Hand-written intrinsic code for sigmoid on different architectures is provided. - Multiversioning: A central problem for SIMD is multiversioning and runtime dispatch. Different approaches like
multiversion
crate,rust-target-feature-dispatch
, and writing functions polymorphic on a zero-sized SIMD type are discussed. Thefearless_simd#2
prototype is proposed with arithmetic traits for vector types. - FP16 and AVX-512: Smaller scalars with higher throughputs are a trend. Native Rust support for
f16
is awaited. AVX-512 has pros and cons, and Intel is proposing AVX10. - About std::simd: It focuses on portability and doesn't solve the multiversion problem, considered a souped-up version of autovectorization.
- Language Evolution: Rust's SIMD support is rough. Proposals like
target_feature 1.1
and safe intrinsics incore::arch
are in progress to improve. More work is needed to help the compiler recognize safe SIMD use. - Looking Forward: The goal is to spark conversation on supporting SIMD programming in Rust. The Vello project needs good SIMD code, and the Rust ecosystem should build infrastructure similar to Highway.
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。