This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: __HAVE_64B_ATOMICS and alignment
- From: Torvald Riegel <triegel at redhat dot com>
- To: Florian Weimer <fweimer at redhat dot com>
- Cc: GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 13 Apr 2017 19:16:52 +0200
- Subject: Re: __HAVE_64B_ATOMICS and alignment
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com
- Authentication-results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=triegel at redhat dot com
- Dkim-filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 9DF417E9D2
- Dmarc-filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 9DF417E9D2
- References: <430bd9b7-a6fd-7247-7b60-965bd0486bbf@redhat.com> <1480333887.7146.1635.camel@localhost.localdomain> <a70fe786-4cfd-278f-7743-32e581c5af55@redhat.com>
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.
Either way, glibc does not provide 64b atomics on i686. If we would
change that, we would have to review data structure declarations,
including alignment, of data that could be the target of such 64b
atomics.