Can this function be auto vectorized with NEON?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Greetings,

I currently try to have this matrix-vector multiplication function auto-vectorized to Aaarch64 armv8 NEON instructions and a 9.3.0 gcc without success:

https://github.com/g-truc/glm/blob/b3f87720261d623986f164b2a7f6a0a938430271/glm/detail/type_mat4x4.inl#L536
[https://opengraph.githubassets.com/8c183f4120fbe851c5fc8496ce4638436329666708589299a2cdae3043ba4284/g-truc/glm]<https://github.com/g-truc/glm/blob/b3f87720261d623986f164b2a7f6a0a938430271/glm/detail/type_mat4x4.inl#L536>
glm/type_mat4x4.inl at b3f87720261d623986f164b2a7f6a0a938430271 · g-truc/glm<https://github.com/g-truc/glm/blob/b3f87720261d623986f164b2a7f6a0a938430271/glm/detail/type_mat4x4.inl#L536>
OpenGL Mathematics (GLM). Contribute to g-truc/glm development by creating an account on GitHub.
github.com
I also tried replacing it with the explicit version commented out:

return typename mat<4, 4, T, Q>::col_type(
m[0][0] * v[0] + m[1][0] * v[1] + m[2][0] * v[2] + m[3][0] * v[3],
m[0][1] * v[0] + m[1][1] * v[1] + m[2][1] * v[2] + m[3][1] * v[3],
m[0][2] * v[0] + m[1][2] * v[1] + m[2][2] * v[2] + m[3][2] * v[3],
m[0][3] * v[0] + m[1][3] * v[1] + m[2][3] * v[2] + m[3][3] * v[3]);

I tried -O3 and -ftree-vectorize but it only produces the usual fmadd etc. instructions, no NEON.

Can someone tell me which parameters g++ needs to even consider NEON?

Regards




[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux