Re: [libcxx] r248313 - Add placeholder __libcpp_relaxed_store() for when atomic builtins are not available.

2015-10-02 Thread Marshall Clow via cfe-commits
On Fri, Oct 2, 2015 at 1:58 PM, Eric Fiselier  wrote:

> Hi Tom,
>
> I would like this patch merged into 3.7.1.
> Marshall can you please approve this?
>

Looks fine to me.

-- Marshall


>
> /Eric
>
> On Tue, Sep 22, 2015 at 12:55 PM, Dimitry Andric via cfe-commits
>  wrote:
> > Author: dim
> > Date: Tue Sep 22 13:55:37 2015
> > New Revision: 248313
> >
> > URL: http://llvm.org/viewvc/llvm-project?rev=248313=rev
> > Log:
> > Add placeholder __libcpp_relaxed_store() for when atomic builtins are
> not available.
> >
> > Summary:
> > In rL241532, atomic_support.h was added, which provides handling of
> > atomic operations for libc++.  When atomic builtins are not available,
> > it emits a warning about being unsupported, but it still provides a
> > number of stubs for the required functions.
> >
> > However, it misses a stub for `__libcpp_relaxed_store()`.  Add it, by
> > using the same implementation as for `__libcpp_atomic_store()`.
> >
> > (Note that I encountered this on arm-freebsd, which still defaults to
> > armv4, and does not have the runtime libcalls to support atomic
> > builtins.  For now, I have simply disabled using them.)
> >
> > Reviewers: mclow.lists, EricWF
> >
> > Subscribers: theraven, cfe-commits, jroelofs, majnemer, aemerson
> >
> > Differential Revision: http://reviews.llvm.org/D13051
> >
> > Modified:
> > libcxx/trunk/src/include/atomic_support.h
> >
> > Modified: libcxx/trunk/src/include/atomic_support.h
> > URL:
> http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/include/atomic_support.h?rev=248313=248312=248313=diff
> >
> ==
> > --- libcxx/trunk/src/include/atomic_support.h (original)
> > +++ libcxx/trunk/src/include/atomic_support.h Tue Sep 22 13:55:37 2015
> > @@ -103,6 +103,13 @@ void __libcpp_atomic_store(_ValueType* _
> >  *__dest = __val;
> >  }
> >
> > +template 
> > +inline _LIBCPP_INLINE_VISIBILITY
> > +void __libcpp_relaxed_store(_ValueType* __dest, _FromType __val)
> > +{
> > +*__dest = __val;
> > +}
> > +
> >  template 
> >  inline _LIBCPP_INLINE_VISIBILITY
> >  _ValueType __libcpp_atomic_load(_ValueType const* __val,
> >
> >
> > ___
> > cfe-commits mailing list
> > cfe-commits@lists.llvm.org
> > http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits
>
___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits


[libcxx] r248313 - Add placeholder __libcpp_relaxed_store() for when atomic builtins are not available.

2015-09-22 Thread Dimitry Andric via cfe-commits
Author: dim
Date: Tue Sep 22 13:55:37 2015
New Revision: 248313

URL: http://llvm.org/viewvc/llvm-project?rev=248313=rev
Log:
Add placeholder __libcpp_relaxed_store() for when atomic builtins are not 
available.

Summary:
In rL241532, atomic_support.h was added, which provides handling of
atomic operations for libc++.  When atomic builtins are not available,
it emits a warning about being unsupported, but it still provides a
number of stubs for the required functions.

However, it misses a stub for `__libcpp_relaxed_store()`.  Add it, by
using the same implementation as for `__libcpp_atomic_store()`.

(Note that I encountered this on arm-freebsd, which still defaults to
armv4, and does not have the runtime libcalls to support atomic
builtins.  For now, I have simply disabled using them.)

Reviewers: mclow.lists, EricWF

Subscribers: theraven, cfe-commits, jroelofs, majnemer, aemerson

Differential Revision: http://reviews.llvm.org/D13051

Modified:
libcxx/trunk/src/include/atomic_support.h

Modified: libcxx/trunk/src/include/atomic_support.h
URL: 
http://llvm.org/viewvc/llvm-project/libcxx/trunk/src/include/atomic_support.h?rev=248313=248312=248313=diff
==
--- libcxx/trunk/src/include/atomic_support.h (original)
+++ libcxx/trunk/src/include/atomic_support.h Tue Sep 22 13:55:37 2015
@@ -103,6 +103,13 @@ void __libcpp_atomic_store(_ValueType* _
 *__dest = __val;
 }
 
+template 
+inline _LIBCPP_INLINE_VISIBILITY
+void __libcpp_relaxed_store(_ValueType* __dest, _FromType __val)
+{
+*__dest = __val;
+}
+
 template 
 inline _LIBCPP_INLINE_VISIBILITY
 _ValueType __libcpp_atomic_load(_ValueType const* __val,


___
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits