[PATCH] D13051: Add placeholder __libcpp_relaxed_store() for when atomic builtins are not available.

Joerg Sonnenberger via cfe-commits cfe-commits at lists.llvm.org
Tue Sep 22 13:01:22 PDT 2015


On Tue, Sep 22, 2015 at 07:26:46PM +0000, Jonathan Roelofs via cfe-commits wrote:
> jroelofs added a comment.
> 
> In http://reviews.llvm.org/D13051#250910, @EricWF wrote:
> 
> > @jroelofs @dim, could we fallback to the __sync_* builtins on arm?
> 
> 
> @dim would need armv4-flavored implementations of them in compiler-rt
> (if that's what he's using)... the existing ones use instructions that
> v4 doesn't have. Implementation-wise, they'd have to use
> `__kuser_cmpxchg`. See: https://www.kernel.org/doc/Documentation/arm/kernel_user_helpers.txt

That's a Linux-specific function/system call. That's not really helpful
on FreeBSD. NetBSD provides restartable atomic sequences for this
purpose.

Joerg


More information about the cfe-commits mailing list