News for hackers. Stuff that matters.
Re:Java and SIMD by evincarofautumn on Tuesday June 27, 2017 @06:33PM (#14650157)
I’ve had similar experiences. If I want vectorised code, I just write it myself using intrinsics or assembly. It’s fine if the compiler can autovectorise something I didn’t feel like doing by hand, but I’m not going to rely on heuristic voodoo to get the machine code I want for a hot loop. I wouldn’t mind a slightly nicer wrapper API for the intrinsics, though, something like glsl-sse2[1].

And that’s more or less what I’m planning to do in a programming language I’m working on, actually—if you use a SIMD-compatible array type, the compiler will try to keep it in a vector register, and some operations will be faster (e.g., “+” on two Float32^4 values will compile to an addps) but it’s up to the programmer to use the instructions they actually want, or tell the compiler with a macro “please vectorise this loop or warn me about why you can’t”.

[1] https://github.com/LiraNuna/glsl-sse2

Re:Java and SIMD by t0rakka on Wednesday June 28, 2017 @07:41AM (#14653265)