News for hackers. Stuff that matters.
Re:SIMD Programming in Pure Rust by wyldfire on Wednesday January 21, 2026 @08:21PM (#46713985)
Does Rust provide architecture-specific intrinsics like C/C++ toolchains usually do? That's a popular way to do SIMD.
Re:SIMD Programming in Pure Rust by steveklabnik on Wednesday January 21, 2026 @08:48PM (#46714190)
Re:SIMD Programming in Pure Rust by m-hilgendorf on Wednesday January 21, 2026 @11:56PM (#46715497)
People should be aware though that without `-C target_feature=+<feature>` in your rustc flags the compiler may emit function calls to stubs for the intrinsic. So people should make sure they're passing the appropriate target features, especially when benchmarking.

[0] https://godbolt.org/z/85nx44zcE

edited: I tested gcc/clang and they just straight up fail to compile without -msse3. The generated code optimizations is also pretty bonkers!

Re:SIMD Programming in Pure Rust by wyldfire on Thursday January 22, 2026 @01:24PM (#46723162)
> compiler may emit function calls to stubs for the intrinsic.

I guess the compiler itself might not know how those calls get resolved but the linker or cargo or some other mechanism might decide to include a library that provides stubs.

Why would anyone ever want that behavior? nop stubs could conceivably be used in some compiler isolated (no-execution) testing scenario but I'd expect it to be opt-in.

Re:SIMD Programming in Pure Rust by karavelov on Wednesday January 21, 2026 @08:53PM (#46714222)
Yes, in the submodules of `std::arch`