Skip to content

Commit

Permalink
Merge branch 'rickard/libatomic_ops_improvements/OTP-12302' into maint
Browse files Browse the repository at this point in the history
* rickard/libatomic_ops_improvements/OTP-12302:
  Implement support for double word atomics using libatomic_ops
  Improve usage of libatomic_ops for word size atomics
  • Loading branch information
rickard-green committed Nov 25, 2014
2 parents 0ab1d95 + d642dc8 commit 91d8aa5
Show file tree
Hide file tree
Showing 10 changed files with 1,037 additions and 10 deletions.
22 changes: 22 additions & 0 deletions aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1421,9 +1421,31 @@ case "$THR_LIB_NAME" in
int z;
AO_nop_full();
#if defined(AO_HAVE_store)
AO_store(&x, (AO_t) 0);
#elif defined(AO_HAVE_store_release)
AO_store_release(&x, (AO_t) 0);
#else
#error No store
#endif
#if defined(AO_HAVE_load)
z = AO_load(&x);
#elif defined(AO_HAVE_load_acquire)
z = AO_load_acquire(&x);
#else
#error No load
#endif
#if defined(AO_HAVE_compare_and_swap_full)
z = AO_compare_and_swap_full(&x, (AO_t) 0, (AO_t) 1);
#elif defined(AO_HAVE_compare_and_swap_release)
z = AO_compare_and_swap_release(&x, (AO_t) 0, (AO_t) 1);
#elif defined(AO_HAVE_compare_and_swap_acquire)
z = AO_compare_and_swap_acquire(&x, (AO_t) 0, (AO_t) 1);
#elif defined(AO_HAVE_compare_and_swap)
z = AO_compare_and_swap(&x, (AO_t) 0, (AO_t) 1);
#else
#error No compare_and_swap
#endif
],
[ethr_have_native_atomics=yes
ethr_have_libatomic_ops=yes])
Expand Down
22 changes: 22 additions & 0 deletions erts/aclocal.m4
Original file line number Diff line number Diff line change
Expand Up @@ -1421,9 +1421,31 @@ case "$THR_LIB_NAME" in
int z;
AO_nop_full();
#if defined(AO_HAVE_store)
AO_store(&x, (AO_t) 0);
#elif defined(AO_HAVE_store_release)
AO_store_release(&x, (AO_t) 0);
#else
#error No store
#endif
#if defined(AO_HAVE_load)
z = AO_load(&x);
#elif defined(AO_HAVE_load_acquire)
z = AO_load_acquire(&x);
#else
#error No load
#endif
#if defined(AO_HAVE_compare_and_swap_full)
z = AO_compare_and_swap_full(&x, (AO_t) 0, (AO_t) 1);
#elif defined(AO_HAVE_compare_and_swap_release)
z = AO_compare_and_swap_release(&x, (AO_t) 0, (AO_t) 1);
#elif defined(AO_HAVE_compare_and_swap_acquire)
z = AO_compare_and_swap_acquire(&x, (AO_t) 0, (AO_t) 1);
#elif defined(AO_HAVE_compare_and_swap)
z = AO_compare_and_swap(&x, (AO_t) 0, (AO_t) 1);
#else
#error No compare_and_swap
#endif
],
[ethr_have_native_atomics=yes
ethr_have_libatomic_ops=yes])
Expand Down
2 changes: 1 addition & 1 deletion erts/include/internal/ethread.h
Original file line number Diff line number Diff line change
Expand Up @@ -364,8 +364,8 @@ extern ethr_runtime_t ethr_runtime__;
# include "sparc64/ethread.h"
# endif
# endif
# include "gcc/ethread.h"
# include "libatomic_ops/ethread.h"
# include "gcc/ethread.h"
# endif
# elif defined(ETHR_HAVE_LIBATOMIC_OPS)
# include "libatomic_ops/ethread.h"
Expand Down
Loading

0 comments on commit 91d8aa5

Please sign in to comment.