108 points by davikr 3 days ago | 18 comments
kookamamie 3 days ago
It would be nice to have a sort of autovec-or-error annotation for preventing this.
dwattttt 3 days ago
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.
flohofwoe 3 days ago
https://www.godbolt.org/z/MW8WeYjGo
Not sure why Rust needs a lot of experimenting tbh, it's been in Clang since forever.
steveklabnik 3 days ago
kookamamie 3 days ago
charleslmunger 2 days ago
https://godbolt.org/#z:OYLghAFBqd5QCxAYwPYBMCmBRdBLAF1QCcAaP...
kookamamie 2 days ago
dagw 3 days ago
davidhyde 3 days ago
incognito124 2 days ago
muyanapar 1 day ago