It would be nice to have a sort of autovec-or-error annotation for preventing this.
It would be nice to have a sort of autovec-or-error annotation for preventing this.
It defines a generic `Simd<T, N>` type, expressing "This is a vector of T elements (such as i8), and is present in chunks of N". Methods that are easily vectorisable are defined on it, so if you can express what you want to do with one, you'll get well defined vectorised operations. Maybe not as perfect as you could hand write if you know what you're doing, but it _does_ guarantee to use vector instructions, so you're not at the behest of the compiler recognising a loop idiom.
https://www.godbolt.org/z/MW8WeYjGo
Not sure why Rust needs a lot of experimenting tbh, it's been in Clang since forever.
https://godbolt.org/#z:OYLghAFBqd5QCxAYwPYBMCmBRdBLAF1QCcAaP...