public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "wilco at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug target/108659] Suboptimal 128 bit atomics codegen on AArch64 and x64
Date: Fri, 03 Feb 2023 21:04:44 +0000	[thread overview]
Message-ID: <bug-108659-4-5fVhWT0F6I@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-108659-4@http.gcc.gnu.org/bugzilla/>

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

Wilco <wilco at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |wilco at gcc dot gnu.org

--- Comment #5 from Wilco <wilco at gcc dot gnu.org> ---
(In reply to Andrew Pinski from comment #4)
> (In reply to Niall Douglas from comment #3) 
> > You may be interested in reading https://reviews.llvm.org/D110069. It wanted
> > to have LLVM generate a 128 bit AArch64 CAS for atomics. LLVM merged that
> > change, it'll be in the next release.
> 
> Using CAS for atomic load is not valid thing to do ...
> Because atomic load from constant rodata needs to work.
> LLVM breaks this case as they don't care about it. GCC does though.

The question is how useful is this in reality? If memory is not writeable then
you can use atomic loads but no other atomic accesses.

We could be pragmatic and say that using 128-bit atomic loads from
non-writeable memory is a user error just like unaligned atomic accesses.

To me a far worse issue is that this difference for 128-bit atomics means that
LLVM and GCC are binary incompatible. AFAIK isn't an option to make them
compatible either (on AArch64 GCC13 will use a compatible sequence only if LSE2
is available).

  parent reply	other threads:[~2023-02-03 21:04 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-03 15:42 [Bug c++/108659] New: " s_gccbugzilla at nedprod dot com
2023-02-03 16:02 ` [Bug target/108659] " jakub at gcc dot gnu.org
2023-02-03 16:14 ` ktkachov at gcc dot gnu.org
2023-02-03 17:14 ` s_gccbugzilla at nedprod dot com
2023-02-03 17:20 ` pinskia at gcc dot gnu.org
2023-02-03 21:04 ` wilco at gcc dot gnu.org [this message]
2023-02-03 21:08 ` pinskia at gcc dot gnu.org
2023-02-03 21:22 ` s_gccbugzilla at nedprod dot com
2023-02-03 21:51 ` wilco at gcc dot gnu.org
2023-02-03 21:58 ` jakub at gcc dot gnu.org
2023-02-03 22:34 ` s_gccbugzilla at nedprod dot com
2023-02-03 22:45 ` wilco at gcc dot gnu.org
2023-05-31 13:25 ` [Bug target/108659] Suboptimal 128 bit atomics codegen x64 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-108659-4-5fVhWT0F6I@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).