This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH 1/2] Optimize generic spinlock code and use C11 like atomic macros.


On Thu, 6 Apr 2017, Torvald Riegel wrote:

> Have you been actually looking at these?  The next line in the file is a
> pretty obvious hint that this is an LLSC machine, and atomic_exchange
> isn't defined anywhere:
> 
> >  /* Microblaze does not have byte and halfword forms of load and reserve and
> > diff --git a/sysdeps/mips/atomic-machine.h b/sysdeps/mips/atomic-machine.h
> > index 54c182b..3d9da0c 100644
> > --- a/sysdeps/mips/atomic-machine.h
> > 
> > +++ b/sysdeps/mips/atomic-machine.h
> > 
> > @@ -50,6 +50,8 @@ typedef uintmax_t uatomic_max_t;
> >  #define __HAVE_64B_ATOMICS 1
> >  #endif
> >  
> > +#define ATOMIC_EXCHANGE_USES_CAS 0
> > 
> > +
> 
> Please ask the MIPS maintainers to review this.

MIPS is an LLSC machine.  However, XLP has a direct atomic exchange 
instruction (so that will be used if _MIPS_ARCH_XLP is defined, in the 
case where this header is using compiler builtins).

-- 
Joseph S. Myers
joseph@codesourcery.com


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]