public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ajidala at gmail dot com" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/100745] GCC generates suboptimal assembly from vector extensions on AArch64
Date: Mon, 24 May 2021 20:27:45 +0000	[thread overview]
Message-ID: <bug-100745-4-Lcn6g4vqrV@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100745-4@http.gcc.gnu.org/bugzilla/>

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100745

--- Comment #1 from Nicolas F. <ajidala at gmail dot com> ---
I'll attach a second version of profile.c, with the vector extension code
that's actually going to be used in mpv (some cleanup has been done).
Performance is unchanged. Some absolute numbers from gcc 11.1.0:

$ ./profile 
old: 811703
nicolas: 262007 (3.10x as fast)
niklas: 679524 (1.19x as fast)

Some absolute numbers from Clang -O3:

$ ./profile 
old: 1547552
nicolas: 269081 (5.75x as fast)
niklas: 246508 (6.28x as fast)

As you can see, Clang does significantly worse on the C version (yay GCC!), but
significantly, and most importantly, in absolute terms, better on the vector
version. Like more than twice as fast than GCC's code.

Looking at GCC's assembly output, I can see some odd choices, such as shuffling
vectors around on the stack instead of using the other scratch registers
(v21-v30), whereas clang does use those scratch registers.

  reply	other threads:[~2021-05-24 20:27 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-24 14:11 [Bug target/100745] New: " ajidala at gmail dot com
2021-05-24 20:27 ` ajidala at gmail dot com [this message]
2021-05-24 20:28 ` [Bug target/100745] " ajidala at gmail dot com
2024-02-27  8:53 ` [Bug tree-optimization/100745] " pinskia at gcc dot gnu.org
2024-04-03 16:54 ` pinskia at gcc dot gnu.org

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=bug-100745-4-Lcn6g4vqrV@http.gcc.gnu.org/bugzilla/ \
    --to=gcc-bugzilla@gcc.gnu.org \
    --cc=gcc-bugs@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).