Remix.run Logo
▲ vlovich123 8 hours ago

The autovectorizer afaik rarely emits optimizations for the different vector units to support + efficiently caches the CPUid check to happen once on program start. It’s a good baseline but the continuum (today) is scalar -> auto vectorized -> portable SIMD -> hand rolled explicit. That portable SIMD lets you bridge into hand rolled explicit ergonomically is a power auto-vectorization doesn’t have. Either the compiler does it or doesn’t but you have no way to even have a check that says “fail to build the program if this function isn’t vectorized”. This is important if you’re relying on that property and someone accidentally adds a data dependency and breaks the optimization without you realizing. Portable and explicit SIMD don’t have this problem by definition.

▲Asmod4n 4 hours ago | parent [-]

Well, let’s hope rust is better than std::simd from c++ here which lacks the capability to emit some intrinsics.

Gcc and llvm can tell you if they can’t Auto vec a function, maybe rust could turn this into an error at comptime.