From 48168a6d455c2fd2f6f19c8f1ae3b1ed4dbfcbbc Mon Sep 17 00:00:00 2001 From: Ivan Maidanski Date: Tue, 7 Apr 2020 09:54:49 +0300 Subject: Use GCC atomic intrinsics for s390x (clang 8.0+) * src/atomic_ops/sysdeps/gcc/s390.h [AO_CLANG_PREREQ(8,0) && __s390x__ && !AO_DISABLE_GCC_ATOMICS]: Include generic.h. * src/atomic_ops/sysdeps/gcc/s390.h [!(AO_CLANG_PREREQ(8,0) && __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_CLANG_PREREQ(8,0) && __s390x__ && !AO_DISABLE_GCC_ATOMICS)] (AO_compare_and_swap_full, AO_fetch_compare_and_swap_full): Do not define. --- src/atomic_ops/sysdeps/gcc/s390.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/atomic_ops/sysdeps/gcc/s390.h b/src/atomic_ops/sysdeps/gcc/s390.h index aece4d2..9b31da8 100644 --- a/src/atomic_ops/sysdeps/gcc/s390.h +++ b/src/atomic_ops/sysdeps/gcc/s390.h @@ -15,10 +15,10 @@ * */ -#if AO_GNUC_PREREQ(5, 4) && defined(__s390x__) \ +#if (AO_GNUC_PREREQ(5, 4) || AO_CLANG_PREREQ(8, 0)) && 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. */ + /* Probably, it could be enabled for earlier clang/gcc versions. */ + /* But, e.g., clang-3.8.0 produces a backend error for AtomicFence. */ # include "generic.h" -- cgit v1.2.1