static unsafe void Transpose(M* m, M* transposed)
{
//A weird function! Why?
//1) Missing some helpful instructions for actual SIMD accelerated transposition.
//2) Difficult to get SIMD types to generate competitive codegen due to lots of componentwise access.
float m12 = m->M12;
float m13 = m->M13;
float m14 = m->M14;
float m23 = m->M23;
float m24 = m->M24;
float m34 = m->M34;
transposed->M11 = m->M11;
transposed->M12 = m->M21;
transposed->M13 = m->M31;
transposed->M14 = m->M41;
transposed->M21 = m12;
transposed->M22 = m->M22;
transposed->M23 = m->M32;
transposed->M24 = m->M42;
transposed->M31 = m13;
transposed->M32 = m23;
transposed->M33 = m->M33;
transposed->M34 = m->M43;
transposed->M41 = m14;
transposed->M42 = m24;
transposed->M43 = m34;
transposed->M44 = m->M44;
}