public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
From: Edgar Mobile <heideggm@hotmail.com>
To: "gcc-help@gcc.gnu.org" <gcc-help@gcc.gnu.org>
Subject: Can this function be auto vectorized with NEON?
Date: Fri, 22 Jul 2022 07:51:03 +0000	[thread overview]
Message-ID: <DM8PR16MB4357D3ECA17EA1CDB2E0EC4AC7909@DM8PR16MB4357.namprd16.prod.outlook.com> (raw)

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

                 reply	other threads:[~2022-07-22  7:51 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=DM8PR16MB4357D3ECA17EA1CDB2E0EC4AC7909@DM8PR16MB4357.namprd16.prod.outlook.com \
    --to=heideggm@hotmail.com \
    --cc=gcc-help@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).