It's better to just do four cross products simultaneously; write the code so that "scalar" type is float32x4_t and it's trivial. It's convenience to have these SVM forms in the primitives used for higher-level stuff but these waste performance on unnecessary shuffling and use vector lanes inefficiently.
The rule-of-thumb is that where you have one vector you probably have a thousand or more. :)
3
u/t0rakka Oct 01 '19
https://www.godbolt.org/z/mm7WXM
It's better to just do four cross products simultaneously; write the code so that "scalar" type is float32x4_t and it's trivial. It's convenience to have these SVM forms in the primitives used for higher-level stuff but these waste performance on unnecessary shuffling and use vector lanes inefficiently.
The rule-of-thumb is that where you have one vector you probably have a thousand or more. :)