From: Janne Blomqvist <blomqvist.janne@gmail.com>
To: Florian Weimer <fweimer@redhat.com>
Cc: nruslan_devel@yahoo.com, gcc mailing list <gcc@gcc.gnu.org>
Subject: Re: GCC interpretation of C11 atomics (DR 459)
Date: Mon, 26 Feb 2018 18:36:00 -0000 [thread overview]
Message-ID: <CAO9iq9FA6GfQnEmQZRPk+PN7-2Y2kuoWX7+=GFoR5e2680ehKw@mail.gmail.com> (raw)
In-Reply-To: <45a88b2b-2e64-58e7-f68b-a1a7511b6528@redhat.com>
On Mon, Feb 26, 2018 at 8:15 PM, Florian Weimer <fweimer@redhat.com> wrote:
> On 02/26/2018 05:00 AM, Ruslan Nikolaev via gcc wrote:
>>
>> If I understand correctly, the redirection to libatomic was made for 2
>> reasons:
>> 1. cmpxchg16b is not available on early amd64 processors. (However, mcx16
>> flag already specifies that you use CPUs that have this instruction, so it
>> should not be a concern when the flag is specified.)
>> 2. atomic_load on read-only memory.
>
>
> I think x86-64 should be able to do atomic load and store via SSE2
> registers,
There is no such architectural guarantee. At least on some
micro-architecture (AMD Opteron "Istanbul") it's possible to construct
a test which fails, proving that at least on that micro-arch SSE2
load/store isn't guaranteed to be atomic. See
https://stackoverflow.com/questions/7646018/sse-instructions-which-cpus-can-do-atomic-16b-memory-operations/7647825
for more discussion and a testcase.
--
Janne Blomqvist
next prev parent reply other threads:[~2018-02-26 18:36 UTC|newest]
Thread overview: 41+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1615980330.4453149.1519617655582.ref@mail.yahoo.com>
2018-02-26 4:01 ` Ruslan Nikolaev via gcc
2018-02-26 5:50 ` Alexander Monakov
2018-02-26 7:24 ` Fw: " Ruslan Nikolaev via gcc
2018-02-26 8:20 ` Alexander Monakov
2018-02-26 8:43 ` Ruslan Nikolaev via gcc
2018-02-26 19:07 ` Torvald Riegel
2018-02-26 19:43 ` Ruslan Nikolaev via gcc
2018-02-26 22:49 ` Ruslan Nikolaev via gcc
2018-02-27 3:33 ` Ruslan Nikolaev via gcc
2018-02-27 10:34 ` Ramana Radhakrishnan
2018-02-27 11:14 ` Torvald Riegel
2018-02-27 12:39 ` Torvald Riegel
2018-02-27 13:04 ` Ruslan Nikolaev via gcc
2018-02-27 13:08 ` Szabolcs Nagy
2018-02-27 13:17 ` Ruslan Nikolaev via gcc
2018-02-27 16:40 ` Torvald Riegel
2018-02-27 17:07 ` Ruslan Nikolaev via gcc
2018-02-27 16:21 ` Torvald Riegel
2018-02-27 16:16 ` Torvald Riegel
2018-02-27 16:46 ` Simon Wright
2018-02-27 16:52 ` Florian Weimer
2018-02-27 17:30 ` Torvald Riegel
2018-02-27 17:33 ` Ruslan Nikolaev via gcc
2018-02-27 19:32 ` Torvald Riegel
2018-02-27 17:59 ` Simon Wright
2018-02-27 10:40 ` Fw: " Torvald Riegel
2018-02-26 18:56 ` Torvald Riegel
2018-02-26 12:30 ` Szabolcs Nagy
2018-02-26 13:57 ` Alexander Monakov
2018-02-26 14:51 ` Szabolcs Nagy
2018-02-26 14:53 ` Ruslan Nikolaev via gcc
2018-02-26 18:35 ` Torvald Riegel
2018-02-26 18:59 ` Ruslan Nikolaev via gcc
2018-02-26 19:20 ` Torvald Riegel
2018-02-26 18:16 ` Florian Weimer
2018-02-26 18:34 ` Ruslan Nikolaev via gcc
2018-02-26 18:36 ` Janne Blomqvist [this message]
2018-02-27 10:22 ` Florian Weimer
[not found] <886227277.5611063.1519759959364.ref@mail.yahoo.com>
2018-02-27 20:20 ` Ruslan Nikolaev via gcc
2018-02-27 22:19 ` Torvald Riegel
2018-02-28 1:46 ` Ruslan Nikolaev via gcc
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='CAO9iq9FA6GfQnEmQZRPk+PN7-2Y2kuoWX7+=GFoR5e2680ehKw@mail.gmail.com' \
--to=blomqvist.janne@gmail.com \
--cc=fweimer@redhat.com \
--cc=gcc@gcc.gnu.org \
--cc=nruslan_devel@yahoo.com \
/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).