On Oct 11, 2011, at 6:22 PM, Lindsey Kuper wrote: > Has there ever been any discussion of vectorization (i.e., taking > advantage of LLVM's vector types) in Rust? Patrick said that he'd > brought it up in passing before, but I don't think I've seen it come > up on the mailing list yet. I'm thinking about trying it out for a > class project. I'm at the "looked at the Wikipedia page some" level > of knowledge about vectorization right now, so I have a lot to learn. > Um…thoughts?
Does LLVM have any support for doing autovectorization? I know it has vector types, and presumably these correspond to SSE or AVX or whatever vector instructions the CPU has. As far as how to exploit these in Rust, I think it'd make sense to have some way of making their use explicit, but higher level than SSE intrinsics like GCC has. Perhaps one way would be to overload operators like plus to work on tuples of numeric types? Tuples of floats match up pretty well with the vector registers in the CPU, I think. I guess this could also be extended to vectors. Another option I'd consider would be making a data parallel library. Even if rustc doesn't generate vectorized code, this library could be implemented in native code using SSE intrinsics. This also might help pave the way for GPU support in the future. -Eric _______________________________________________ Rust-dev mailing list [email protected] https://mail.mozilla.org/listinfo/rust-dev
