Disable 64-bit atomics for MIPS n32 [committed]
Joseph Myers
joseph@codesourcery.com
Wed Jan 28 22:26:00 GMT 2015
On Wed, 28 Jan 2015, Torvald Riegel wrote:
> On Wed, 2015-01-28 at 18:45 +0000, Joseph Myers wrote:
> > This patch disables use of 64-bit atomics for MIPS n32 to fix the
> > problems with unaligned semaphores.
>
> That works. I would probably preferred to just do this in the semaphore
> bits (ie, checking for __HAVE_64B_ATOMICS and _LP64, but both have the
> same effect for 2.21.
Carlos requested the minimal change in
<https://sourceware.org/ml/libc-alpha/2015-01/msg00597.html>.
> I guess I'll have to add another flag for whether 64B atomics need to be
> naturally aligned or not. I'm not yet sure how to express this best, so
> suggestions are welcome. If we can say (for now) that we only support
> ILP32 and LP64, this might clarify the options we have -- I suspect that
> in most cases where 64B atomics will be useful, this will be for legacy
> code.
>
> OTOH, I'm not sure whether non-naturally-aligned 64B atomics actually
> really help us anywhere. So we could as well just require them to be
> naturally aligned, and use _LP64 to check whether alignment for legacy
> code is sufficient.
My view is: only use atomic operations on properly aligned values, define
SEM_USE_64B_ATOMICS or similar to 1 if __HAVE_64B_ATOMICS && (defined
_LP64 || !SHLIB_COMPAT (libpthread, GLIBC_2_0, GLIBC_2_22)) to reflect
that new ILP32 ports added in 2.22 and later (such as AArch64 ILP32)
should define their semaphores to be 8-byte-aligned. (Presuming that such
ports should indeed prefer to use the 64-bit atomics here.) And maybe
then allow ports to override that choice.
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Libc-alpha
mailing list