A perspective of abstracting SIMD that emphasizes how to expose operation intrinsics seems like its lost in the weeds. Is there anything like ISPC for Rust? One of the critical features of ISPC is language support for transforming arrays-of-structs (AOSs) to struct-of-arrays (SOAs). You can define and declare your data structures as you normally would, e.g. `struct foo { float x, y, x } arr[100]`, which is easier to grok and maintain, but the internal memory layout transparently becomes more like `struct { x[100], y[100], x[100] } arr`. See https://ispc.github.io/ispc.html#structure-of-array-types. When such semantics are provided by the language itself, the need to care resort to explicit SIMD intrinsics is tremendously reduced as one of the biggest impediment to autovectorization is lifted. ISPC also similar semantic support for parallel control flow, e.g. conditionals/masking, that likewise significantly obviates the need to directly or indirectly use intrinsics.
raphlinus 2 hours ago [-]
There's a new game in town for portable, multiversioned Rust SIMD: fearless_simd. It's still early days (we're gearing up for an 0.2 release soon), but we are using it very successfully to accelerate rendering algorithms in vello_cpu and vello_hybrid. I believe it represents the best compromise on stable Rust today. We're not saying it's ready for production use yet, but I encourage people exploring this space to try it and give us feedback on how well it works.
There's also a big discussion to be had about how the Rust language might more natively support SIMD. There are some hacks in fearless_simd to work around limitations in the language (especially relying on inlining as load-bearing), and it would be excellent to make that more robust. But the best path forward is not obvious.
There's also a big discussion to be had about how the Rust language might more natively support SIMD. There are some hacks in fearless_simd to work around limitations in the language (especially relying on inlining as load-bearing), and it would be excellent to make that more robust. But the best path forward is not obvious.
[1] https://github.com/linebender/fearless_simd