diff options
| author | Dimitry Andric <dim@FreeBSD.org> | 2020-08-06 19:11:24 +0000 |
|---|---|---|
| committer | Dimitry Andric <dim@FreeBSD.org> | 2020-08-06 19:11:24 +0000 |
| commit | 0faeaeed40a4c42a778a088cbdad0bc54468eef4 (patch) | |
| tree | 62d084de9ed8b89c9a882bac12f64d05b109cf09 /contrib/llvm-project/compiler-rt/lib | |
| parent | e8141ad1df2098dd3f6d627c49ce99307315f5fd (diff) | |
Notes
Diffstat (limited to 'contrib/llvm-project/compiler-rt/lib')
| -rw-r--r-- | contrib/llvm-project/compiler-rt/lib/builtins/atomic.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c b/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c index 8634a72e77d1..2a69101fbcee 100644 --- a/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c +++ b/contrib/llvm-project/compiler-rt/lib/builtins/atomic.c @@ -120,13 +120,20 @@ static __inline Lock *lock_for_pointer(void *ptr) { return locks + (hash & SPINLOCK_MASK); } -/// Macros for determining whether a size is lock free. Clang can not yet -/// codegen __atomic_is_lock_free(16), so for now we assume 16-byte values are -/// not lock free. +/// Macros for determining whether a size is lock free. #define IS_LOCK_FREE_1 __c11_atomic_is_lock_free(1) #define IS_LOCK_FREE_2 __c11_atomic_is_lock_free(2) #define IS_LOCK_FREE_4 __c11_atomic_is_lock_free(4) + +/// 32 bit PowerPC doesn't support 8-byte lock_free atomics +#if !defined(__powerpc64__) && defined(__powerpc__) +#define IS_LOCK_FREE_8 0 +#else #define IS_LOCK_FREE_8 __c11_atomic_is_lock_free(8) +#endif + +/// Clang can not yet codegen __atomic_is_lock_free(16), so for now we assume +/// 16-byte values are not lock free. #define IS_LOCK_FREE_16 0 /// Macro that calls the compiler-generated lock-free versions of functions |
