summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2021-06-11 21:23:25 +0300
committerIvan Maidanski <ivmai@mail.ru>2021-06-11 21:23:25 +0300
commit3401a48ab1d756a7e66230ae88a4e183504bc7ad (patch)
treed8961dddfb54d7a65abc479df417e33529957a9e /src
parent2c264fa8a2a0516e9654af9ba28fc1e9ac2db0cb (diff)
downloadlibatomic_ops-3401a48ab1d756a7e66230ae88a4e183504bc7ad.tar.gz
Allow to generalize bool-CAS for sparc (gcc)
* src/atomic_ops/sysdeps/gcc/sparc.h [!AO_NO_SPARC_V9] (AO_compare_and_swap_full): Do not define if AO_GENERALIZE_ASM_BOOL_CAS.
Diffstat (limited to 'src')
-rw-r--r--src/atomic_ops/sysdeps/gcc/sparc.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/atomic_ops/sysdeps/gcc/sparc.h b/src/atomic_ops/sysdeps/gcc/sparc.h
index 9bd48d4..775da0a 100644
--- a/src/atomic_ops/sysdeps/gcc/sparc.h
+++ b/src/atomic_ops/sysdeps/gcc/sparc.h
@@ -38,6 +38,8 @@ AO_test_and_set_full(volatile AO_TS_t *addr) {
#define AO_HAVE_test_and_set_full
#ifndef AO_NO_SPARC_V9
+
+# ifndef AO_GENERALIZE_ASM_BOOL_CAS
/* Returns nonzero if the comparison succeeded. */
AO_INLINE int
AO_compare_and_swap_full(volatile AO_t *addr, AO_t old, AO_t new_val) {
@@ -59,7 +61,8 @@ AO_compare_and_swap_full(volatile AO_t *addr, AO_t old, AO_t new_val) {
: "memory", "cc");
return (int)ret;
}
-#define AO_HAVE_compare_and_swap_full
+# define AO_HAVE_compare_and_swap_full
+# endif /* !AO_GENERALIZE_ASM_BOOL_CAS */
AO_INLINE AO_t
AO_fetch_compare_and_swap_full(volatile AO_t *addr, AO_t old, AO_t new_val) {
@@ -76,6 +79,7 @@ AO_fetch_compare_and_swap_full(volatile AO_t *addr, AO_t old, AO_t new_val) {
return new_val;
}
#define AO_HAVE_fetch_compare_and_swap_full
+
#endif /* !AO_NO_SPARC_V9 */
/* TODO: Extend this for SPARC v8 and v9 (V8 also has swap, V9 has CAS, */