3 ms·
Thank you for the detailed responses. One, possibly silly, followup question, since you mentioned using AVX. If I understand correctly, Zig deliberately avoids
by keldaris 8y ago
Thank you for the detailed responses. One, possibly silly, followup question, since you mentioned using AVX. If I understand correctly, Zig deliberately avoids macros, metaprogramming and doesn't have operator overloading. Given those limitations, how do you deal with vector math over different SIMD widths without insane verbosity? I feel like I'd be tempted to write a simple code generator before starting on something like that.
- unique_id 8y agoZig has extensive metaprogramming support. For SIMD I'm using ispc which is a shader-like language/compiler from Intel. You write your code from the point of view of a single SIMD lane and the compiler takes care of the rest. Intel kind of screwed the project over with their stupid naming and terrible website but it's a very cool project. I take the resulting object file and link it with the rest of the project. This is very different from trusting a compiler to vectorize your code, with a shading language you know it's going to vectorize. What's absolutely brilliant is when you start to use divergent control flow and see how well it handles it. https://pharr.org/matt/blog/2018/04/18/ispc-origins.html https://pharr.org/matt/blog/2018/04/18/ispc-origins.html