search for: __sync_sub_and_fetch

Displaying 10 results from an estimated 10 matches for "__sync_sub_and_fetch".

2012 Feb 28
0
[LLVMdev] [patch] atomic functions on darwin
...SAtomicIncrement32(vcast(ptr)); #elif defined(__GNUC__) return __sync_add_and_fetch(ptr, 1); #elif defined(_MSC_VER) @@ -69,6 +83,8 @@ #if LLVM_HAS_ATOMICS == 0 --(*ptr); return *ptr; +#elif defined(__APPLE__) + return OSAtomicDecrement32(vcast(ptr)); #elif defined(__GNUC__) return __sync_sub_and_fetch(ptr, 1); #elif defined(_MSC_VER) @@ -82,6 +98,8 @@ #if LLVM_HAS_ATOMICS == 0 *ptr += val; return *ptr; +#elif defined(__APPLE__) + return OSAtomicAdd32(val, vcast(ptr)); #elif defined(__GNUC__) return __sync_add_and_fetch(ptr, val); #elif defined(_MSC_VER) Index: autoconf/configure.ac...
2009 Jul 01
2
[LLVMdev] build failure on ARM linux
...versions below < 4.4 xerxes at labbserver:~/llvm$ grep _sync lib/*/* lib/System/Atomic.cpp: __sync_synchronize(); lib/System/Atomic.cpp: return __sync_val_compare_and_swap(ptr, old_value, new_value); lib/System/Atomic.cpp: return __sync_add_and_fetch(ptr, 1); lib/System/Atomic.cpp: return __sync_sub_and_fetch(ptr, 1); lib/System/Atomic.cpp: return __sync_add_and_fetch(ptr, val); Cheers Xerxes Andrew Haley skrev: > Nick Lewycky wrote: > >> 2009/6/30 Andrew Haley <aph at redhat.com <mailto:aph at redhat.com>> >> >> Nick Lewycky wrote: >> > I'm...
2012 Jul 15
1
[LLVMdev] Errors reported in config.log on linux
...ared in this scope conftest.cpp:164: error: `__sync_synchronize' was not declared in this scope conftest.cpp:165: error: `__sync_val_compare_and_swap' was not declared in this scope conftest.cpp:166: error: `__sync_add_and_fetch' was not declared in this scope conftest.cpp:167: error: `__sync_sub_and_fetch' was not declared in this scope Warnings: conftest.c:87: warning: conflicting types for built-in function 'strchr' conftest.c:88: warning: conflicting types for built-in function 'strrchr' conftest.c:89: warning: conflicting types for built-in function 'memcpy' conftes...
2009 Jun 30
0
[LLVMdev] build failure on ARM linux
Nick Lewycky wrote: > 2009/6/30 Andrew Haley <aph at redhat.com <mailto:aph at redhat.com>> > > Nick Lewycky wrote: > > I'm seeing this new build failure, starting some time yesterday on > ARM: > > Yes. It's just a matter of defining __sync_val_compare_and_swap_4: > >
2015 Feb 26
4
[PATCH v2 1/4] Add atomic_inc_return to atomics.
...>atomic, 1)) +# define atomic_inc_return(x) (__sync_add_and_fetch (&(x)->atomic, 1)) # define atomic_dec_and_test(x) (__sync_fetch_and_add (&(x)->atomic, -1) == 1) # define atomic_add(x, v) ((void) __sync_add_and_fetch(&(x)->atomic, (v))) # define atomic_dec(x, v) ((void) __sync_sub_and_fetch(&(x)->atomic, (v))) @@ -68,6 +69,7 @@ typedef struct { # define atomic_read(x) AO_load_full(&(x)->atomic) # define atomic_set(x, val) AO_store_full(&(x)->atomic, (val)) # define atomic_inc(x) ((void) AO_fetch_and_add1_full(&(x)->atomic)) +# define atomic_inc_return(x)...
2009 Jul 01
0
[LLVMdev] build failure on ARM linux
...; xerxes at labbserver:~/llvm$ grep _sync lib/*/* > lib/System/Atomic.cpp: __sync_synchronize(); > lib/System/Atomic.cpp: return __sync_val_compare_and_swap(ptr, > old_value, new_value); > lib/System/Atomic.cpp: return __sync_add_and_fetch(ptr, 1); > lib/System/Atomic.cpp: return __sync_sub_and_fetch(ptr, 1); > lib/System/Atomic.cpp: return __sync_add_and_fetch(ptr, val); > > Cheers > Xerxes > > Andrew Haley skrev: >> Nick Lewycky wrote: >> >>> 2009/6/30 Andrew Haley <aph at redhat.com <mailto:aph at redhat.com>> >>> >>> N...
2009 Jun 30
3
[LLVMdev] build failure on ARM linux
2009/6/30 Andrew Haley <aph at redhat.com> > Nick Lewycky wrote: > > I'm seeing this new build failure, starting some time yesterday on ARM: > > > > make[3]: Entering directory `/home/nlewycky/llvm/tools/llvmc/driver' > > llvm[3]: Linking Debug executable llvmc > > g++ -DLLVMC_BUILTIN_PLUGIN_1=Base -DLLVMC_BUILTIN_PLUGIN_2=Clang >
2015 Feb 24
4
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...omic, -1) == 1) +# define atomic_inc_return(x) (__sync_add_and_fetch (&(x)->atomic, 1)) +# define atomic_dec_and_test(x) (__sync_add_and_fetch (&(x)->atomic, -1) == 0) # define atomic_add(x, v) ((void) __sync_add_and_fetch(&(x)->atomic, (v))) # define atomic_dec(x, v) ((void) __sync_sub_and_fetch(&(x)->atomic, (v))) # define atomic_cmpxchg(x, oldv, newv) __sync_val_compare_and_swap (&(x)->atomic, oldv, newv) @@ -68,6 +69,7 @@ typedef struct { # define atomic_read(x) AO_load_full(&(x)->atomic) # define atomic_set(x, val) AO_store_full(&(x)->atomic, (val)) # de...
2015 Feb 25
0
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...-1) == 0) The atomic_dec_and_test change seems like unrelated bugfix. Split it out perhaps ? Introduction of atomic_inc_return could/should be a separate commit as well. > # define atomic_add(x, v) ((void) __sync_add_and_fetch(&(x)->atomic, (v))) > # define atomic_dec(x, v) ((void) __sync_sub_and_fetch(&(x)->atomic, (v))) > # define atomic_cmpxchg(x, oldv, newv) __sync_val_compare_and_swap (&(x)->atomic, oldv, newv) > @@ -68,6 +69,7 @@ typedef struct { > # define atomic_read(x) AO_load_full(&(x)->atomic) > # define atomic_set(x, val) AO_store_full(&(x)->...
2015 Feb 25
1
[PATCH 1/2] nouveau: make nouveau importing global buffers completely thread-safe, with tests
...g the order.. - atomic_fetch_and_add(-1) == 1 + atomic_add_and_fetch(-1) == 0 > Introduction of atomic_inc_return could/should be a separate commit as well. >> # define atomic_add(x, v) ((void) __sync_add_and_fetch(&(x)->atomic, (v))) >> # define atomic_dec(x, v) ((void) __sync_sub_and_fetch(&(x)->atomic, (v))) >> # define atomic_cmpxchg(x, oldv, newv) __sync_val_compare_and_swap (&(x)->atomic, oldv, newv) >> @@ -68,6 +69,7 @@ typedef struct { >> # define atomic_read(x) AO_load_full(&(x)->atomic) >> # define atomic_set(x, val) AO_store_fu...