public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Richard Henderson <rth@twiddle.net>
To: Torvald Riegel <triegel@redhat.com>, Florian Weimer <fweimer@redhat.com>
Cc: GNU C Library <libc-alpha@sourceware.org>
Subject: Re: __HAVE_64B_ATOMICS and alignment
Date: Mon, 17 Apr 2017 07:37:00 -0000	[thread overview]
Message-ID: <54996b83-b556-2a31-8a7a-a0700b83cf26@twiddle.net> (raw)
In-Reply-To: <1492103812.5374.218.camel@redhat.com>

On 04/13/2017 10:16 AM, Torvald Riegel wrote:
> On Thu, 2017-04-13 at 07:10 +0200, Florian Weimer wrote:
>> On 11/28/2016 12:51 PM, Torvald Riegel wrote:
>>>> This means that for an LP32 architecture such as i686 which could
>>>> conceivable provide 64-bit atomics, we might try to perform an atomic
>>>> operation on a potentially misaligned uint64_t value.
>>> i686 has no 64b atomic loads or stores.
>>
>> double loads and stores via the FPU are atomic, and they preserve all
>> bit patterns.
>
> I believe that the precise status on this is that we believe that they
> are atomic, but it's not explicitly guaranteed.

No, it is guaranteed.  See Vol 3, Section 8.1.1:

# The Pentium processor (and newer processors since) guarantees that
# the following additional memory operations will always be carried
# out atomically:
# • Reading or writing a quadword aligned on a 64-bit boundary


r~

  reply	other threads:[~2017-04-17  7:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-26 18:49 Florian Weimer
2016-11-26 20:52 ` Andreas Schwab
2016-11-27 11:33   ` Florian Weimer
2016-11-27 12:36     ` Andreas Schwab
2016-11-28 11:51 ` Torvald Riegel
2017-04-13  5:11   ` Florian Weimer
2017-04-13 17:16     ` Torvald Riegel
2017-04-17  7:37       ` Richard Henderson [this message]
2017-04-18 22:13     ` Joseph Myers

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=54996b83-b556-2a31-8a7a-a0700b83cf26@twiddle.net \
    --to=rth@twiddle.net \
    --cc=fweimer@redhat.com \
    --cc=libc-alpha@sourceware.org \
    --cc=triegel@redhat.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).