On Oct 18, 2011, at 8:58 AM, Eric Holk wrote: > > 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.
I'm not sure about CPU vector units, but there's the PTX abstract ISA that compiles to GPU, from NVIDIA. Look for PTX under http://llvm.org/devmtg/2009-10/ and see also https://github.com/jholewinski/llvm-ptx-samples > 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. Have you guys checked out Intel Lab's River Trail yet? http://github.com/RiverTrail/RiverTrail http://brendaneich.com/2011/09/capitoljs-rivertrail/ ParallelArray (immutable, n-dimensional typed array based library abstraction) for JS, with Narcissus-based compiler to OpenCL. A tech demonstrator for sure, we are now working on integration into IonMonkey. /be > > -Eric > _______________________________________________ > Rust-dev mailing list > Rust-dev@mozilla.org > https://mail.mozilla.org/listinfo/rust-dev _______________________________________________ Rust-dev mailing list Rust-dev@mozilla.org https://mail.mozilla.org/listinfo/rust-dev