summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Maidanski <ivmai@mail.ru>2020-04-01 08:48:19 +0300
committerIvan Maidanski <ivmai@mail.ru>2020-04-01 08:48:19 +0300
commit0b71944d9f1845cbf1799bb236c71576c0b227f7 (patch)
tree031e3480361512f2aa9760116b2a2a16cb4418ee /src
parent2ac8c4df8849b3bc077a002040584fa7029ff849 (diff)
downloadlibatomic_ops-0b71944d9f1845cbf1799bb236c71576c0b227f7.tar.gz
Use GCC atomic intrinsics for s390x (GCC 5.4+)
* src/atomic_ops/sysdeps/gcc/s390.h [AO_GNUC_PREREQ(5,4) && __s390x__ && !AO_DISABLE_GCC_ATOMICS]: Include generic.h. * src/atomic_ops/sysdeps/gcc/s390.h [!(AO_GNUC_PREREQ(5,4) && __s390x__ && !AO_DISABLE_GCC_ATOMICS)]: Do not include ordered_except_wr.h, all_aligned_atomic_load_store.h, test_and_set_t_is_ao_t.h. * src/atomic_ops/sysdeps/gcc/s390.h [!(AO_GNUC_PREREQ(5,4) && __s390x__ && !AO_DISABLE_GCC_ATOMICS)] (AO_compare_and_swap_full, AO_fetch_compare_and_swap_full): Do not define.
Diffstat (limited to 'src')
-rw-r--r--src/atomic_ops/sysdeps/gcc/s390.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/atomic_ops/sysdeps/gcc/s390.h b/src/atomic_ops/sysdeps/gcc/s390.h
index 91bec4e..aece4d2 100644
--- a/src/atomic_ops/sysdeps/gcc/s390.h
+++ b/src/atomic_ops/sysdeps/gcc/s390.h
@@ -15,6 +15,15 @@
*
*/
+#if AO_GNUC_PREREQ(5, 4) && defined(__s390x__) \
+ && !defined(AO_DISABLE_GCC_ATOMICS)
+ /* Probably, it could be enabled for earlier gcc versions. */
+ /* TODO: As of clang-3.8.0, an error occurs in backend for AtomicFence. */
+
+# include "generic.h"
+
+#else /* AO_DISABLE_GCC_ATOMICS */
+
/* The relevant documentation appears to be at */
/* http://publibz.boulder.ibm.com/epubs/pdf/dz9zr003.pdf */
/* around page 5-96. Apparently: */
@@ -78,4 +87,6 @@ AO_fetch_compare_and_swap_full(volatile AO_t *addr,
}
#define AO_HAVE_fetch_compare_and_swap_full
+#endif /* AO_DISABLE_GCC_ATOMICS */
+
/* TODO: Add double-wide operations for 32-bit executables. */