4 ms·
There are some efforts underway to standardize using SIMD but this is really a separate problem to providing a short vector math library suitable for the kind o
by mattnewport 8y ago
There are some efforts underway to standardize using SIMD but this is really a separate problem to providing a short vector math library suitable for the kind of linear algebra useful for 3D graphics and physics.
Making your vec4f type a SIMD register type is not a good way to make use of SIMD hardware. The best approach is generally an SoA (Struct of Arrays) rather than an AoS (Array of Structs) and the best CPU programming model for that is something like ispc[1].
Nathan Reed has a good summary of why "naïve" SIMD libraries after not the way to go for short vector math: http://www.reedbeta.com/blog/on-vector-math-libraries/#how-to-simd-and-how-not-to http://www.reedbeta.com/blog/on-vector-math-libraries/#how-t...
On some platforms alignment issues become a big problem for naïve vector math libraries too, though this is less of an issue on current generation x64 hardware.
[1] https://ispc.github.io/ispc.html https://ispc.github.io/ispc.html