]> granicus.if.org Git - libatomic_ops/commitdiff
Avoid __atomic_and/or/xor_fetch if unsupported (clang/arm-v5te)
authorIvan Maidanski <ivmai@mail.ru>
Wed, 13 Apr 2016 23:19:58 +0000 (02:19 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Wed, 13 Apr 2016 23:19:58 +0000 (02:19 +0300)
* src/atomic_ops/sysdeps/gcc/arm.h (AO_SKIPATOMIC_ANY_and_ANY,
AO_SKIPATOMIC_ANY_or_ANY, AO_SKIPATOMIC_ANY_xor_ANY): Define new
internal macro (before include "generic.h") if
AO_GCC_ATOMIC_TEST_AND_SET and __clang__, and not AO_ARM_HAVE_LDREX.
* src/atomic_ops/sysdeps/gcc/generic-arithm.h: Regenerate.
* src/atomic_ops/sysdeps/gcc/generic-arithm.template
(AO_XSIZE_and_XBAR): Do not define if AO_SKIPATOMIC_ANY_and_ANY.
* src/atomic_ops/sysdeps/gcc/generic-arithm.template
(AO_XSIZE_or_XBAR): Do not define if AO_SKIPATOMIC_ANY_or_ANY.
* src/atomic_ops/sysdeps/gcc/generic-arithm.template
(AO_XSIZE_xor_XBAR): Do not define if AO_SKIPATOMIC_ANY_xor_ANY.

src/atomic_ops/sysdeps/gcc/arm.h
src/atomic_ops/sysdeps/gcc/generic-arithm.h
src/atomic_ops/sysdeps/gcc/generic-arithm.template

index 5141d93305358d66590a067144a96094cd470f37..03da07f6976e6e5df9d2e7bee6e435c6f1d06fd4 100644 (file)
@@ -705,6 +705,14 @@ AO_fetch_compare_and_swap(volatile AO_t *addr, AO_t old_val, AO_t new_val)
 
 #else /* AO_GCC_ATOMIC_TEST_AND_SET */
 
+# if defined(__clang__) && !defined(AO_ARM_HAVE_LDREX)
+    /* As of clang-3.8, it cannot compile __atomic_and/or/xor_fetch     */
+    /* library calls yet for pre ARMv7.                                 */
+#   define AO_SKIPATOMIC_ANY_and_ANY
+#   define AO_SKIPATOMIC_ANY_or_ANY
+#   define AO_SKIPATOMIC_ANY_xor_ANY
+# endif
+
 # ifdef AO_ARM_HAVE_LDREXD
 #   include "../standard_ao_double_t.h"
 # endif
index 65e7767bd44d83e062dc15db32d50d4cedc4f5dc..f7f38785a60a3ea8abdbb1590a6e9a9e1cef7b48 100644 (file)
@@ -22,26 +22,32 @@ AO_char_fetch_and_add(volatile unsigned/**/char *addr, unsigned/**/char incr)
 }
 #define AO_HAVE_char_fetch_and_add
 
-AO_INLINE void
-AO_char_and(volatile unsigned/**/char *addr, unsigned/**/char value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_RELAXED);
-}
-#define AO_HAVE_char_and
-
-AO_INLINE void
-AO_char_or(volatile unsigned/**/char *addr, unsigned/**/char value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_RELAXED);
-}
-#define AO_HAVE_char_or
-
-AO_INLINE void
-AO_char_xor(volatile unsigned/**/char *addr, unsigned/**/char value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_RELAXED);
-}
-#define AO_HAVE_char_xor
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_char_and(volatile unsigned/**/char *addr, unsigned/**/char value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_RELAXED);
+  }
+# define AO_HAVE_char_and
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_char_or(volatile unsigned/**/char *addr, unsigned/**/char value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_RELAXED);
+  }
+# define AO_HAVE_char_or
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_char_xor(volatile unsigned/**/char *addr, unsigned/**/char value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_RELAXED);
+  }
+# define AO_HAVE_char_xor
+#endif
 /*
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
@@ -66,26 +72,32 @@ AO_short_fetch_and_add(volatile unsigned/**/short *addr, unsigned/**/short incr)
 }
 #define AO_HAVE_short_fetch_and_add
 
-AO_INLINE void
-AO_short_and(volatile unsigned/**/short *addr, unsigned/**/short value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_RELAXED);
-}
-#define AO_HAVE_short_and
-
-AO_INLINE void
-AO_short_or(volatile unsigned/**/short *addr, unsigned/**/short value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_RELAXED);
-}
-#define AO_HAVE_short_or
-
-AO_INLINE void
-AO_short_xor(volatile unsigned/**/short *addr, unsigned/**/short value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_RELAXED);
-}
-#define AO_HAVE_short_xor
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_short_and(volatile unsigned/**/short *addr, unsigned/**/short value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_RELAXED);
+  }
+# define AO_HAVE_short_and
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_short_or(volatile unsigned/**/short *addr, unsigned/**/short value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_RELAXED);
+  }
+# define AO_HAVE_short_or
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_short_xor(volatile unsigned/**/short *addr, unsigned/**/short value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_RELAXED);
+  }
+# define AO_HAVE_short_xor
+#endif
 /*
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
@@ -110,26 +122,32 @@ AO_int_fetch_and_add(volatile unsigned *addr, unsigned incr)
 }
 #define AO_HAVE_int_fetch_and_add
 
-AO_INLINE void
-AO_int_and(volatile unsigned *addr, unsigned value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_RELAXED);
-}
-#define AO_HAVE_int_and
-
-AO_INLINE void
-AO_int_or(volatile unsigned *addr, unsigned value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_RELAXED);
-}
-#define AO_HAVE_int_or
-
-AO_INLINE void
-AO_int_xor(volatile unsigned *addr, unsigned value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_RELAXED);
-}
-#define AO_HAVE_int_xor
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_int_and(volatile unsigned *addr, unsigned value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_RELAXED);
+  }
+# define AO_HAVE_int_and
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_int_or(volatile unsigned *addr, unsigned value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_RELAXED);
+  }
+# define AO_HAVE_int_or
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_int_xor(volatile unsigned *addr, unsigned value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_RELAXED);
+  }
+# define AO_HAVE_int_xor
+#endif
 /*
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
@@ -154,26 +172,32 @@ AO_fetch_and_add(volatile AO_t *addr, AO_t incr)
 }
 #define AO_HAVE_fetch_and_add
 
-AO_INLINE void
-AO_and(volatile AO_t *addr, AO_t value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_RELAXED);
-}
-#define AO_HAVE_and
-
-AO_INLINE void
-AO_or(volatile AO_t *addr, AO_t value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_RELAXED);
-}
-#define AO_HAVE_or
-
-AO_INLINE void
-AO_xor(volatile AO_t *addr, AO_t value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_RELAXED);
-}
-#define AO_HAVE_xor
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_and(volatile AO_t *addr, AO_t value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_RELAXED);
+  }
+# define AO_HAVE_and
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_or(volatile AO_t *addr, AO_t value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_RELAXED);
+  }
+# define AO_HAVE_or
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_xor(volatile AO_t *addr, AO_t value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_RELAXED);
+  }
+# define AO_HAVE_xor
+#endif
 /*
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
@@ -198,26 +222,32 @@ AO_char_fetch_and_add_acquire(volatile unsigned/**/char *addr, unsigned/**/char
 }
 #define AO_HAVE_char_fetch_and_add_acquire
 
-AO_INLINE void
-AO_char_and_acquire(volatile unsigned/**/char *addr, unsigned/**/char value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_ACQUIRE);
-}
-#define AO_HAVE_char_and_acquire
-
-AO_INLINE void
-AO_char_or_acquire(volatile unsigned/**/char *addr, unsigned/**/char value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_ACQUIRE);
-}
-#define AO_HAVE_char_or_acquire
-
-AO_INLINE void
-AO_char_xor_acquire(volatile unsigned/**/char *addr, unsigned/**/char value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_ACQUIRE);
-}
-#define AO_HAVE_char_xor_acquire
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_char_and_acquire(volatile unsigned/**/char *addr, unsigned/**/char value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_ACQUIRE);
+  }
+# define AO_HAVE_char_and_acquire
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_char_or_acquire(volatile unsigned/**/char *addr, unsigned/**/char value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_ACQUIRE);
+  }
+# define AO_HAVE_char_or_acquire
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_char_xor_acquire(volatile unsigned/**/char *addr, unsigned/**/char value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_ACQUIRE);
+  }
+# define AO_HAVE_char_xor_acquire
+#endif
 /*
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
@@ -242,26 +272,32 @@ AO_short_fetch_and_add_acquire(volatile unsigned/**/short *addr, unsigned/**/sho
 }
 #define AO_HAVE_short_fetch_and_add_acquire
 
-AO_INLINE void
-AO_short_and_acquire(volatile unsigned/**/short *addr, unsigned/**/short value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_ACQUIRE);
-}
-#define AO_HAVE_short_and_acquire
-
-AO_INLINE void
-AO_short_or_acquire(volatile unsigned/**/short *addr, unsigned/**/short value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_ACQUIRE);
-}
-#define AO_HAVE_short_or_acquire
-
-AO_INLINE void
-AO_short_xor_acquire(volatile unsigned/**/short *addr, unsigned/**/short value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_ACQUIRE);
-}
-#define AO_HAVE_short_xor_acquire
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_short_and_acquire(volatile unsigned/**/short *addr, unsigned/**/short value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_ACQUIRE);
+  }
+# define AO_HAVE_short_and_acquire
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_short_or_acquire(volatile unsigned/**/short *addr, unsigned/**/short value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_ACQUIRE);
+  }
+# define AO_HAVE_short_or_acquire
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_short_xor_acquire(volatile unsigned/**/short *addr, unsigned/**/short value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_ACQUIRE);
+  }
+# define AO_HAVE_short_xor_acquire
+#endif
 /*
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
@@ -286,26 +322,32 @@ AO_int_fetch_and_add_acquire(volatile unsigned *addr, unsigned incr)
 }
 #define AO_HAVE_int_fetch_and_add_acquire
 
-AO_INLINE void
-AO_int_and_acquire(volatile unsigned *addr, unsigned value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_ACQUIRE);
-}
-#define AO_HAVE_int_and_acquire
-
-AO_INLINE void
-AO_int_or_acquire(volatile unsigned *addr, unsigned value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_ACQUIRE);
-}
-#define AO_HAVE_int_or_acquire
-
-AO_INLINE void
-AO_int_xor_acquire(volatile unsigned *addr, unsigned value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_ACQUIRE);
-}
-#define AO_HAVE_int_xor_acquire
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_int_and_acquire(volatile unsigned *addr, unsigned value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_ACQUIRE);
+  }
+# define AO_HAVE_int_and_acquire
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_int_or_acquire(volatile unsigned *addr, unsigned value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_ACQUIRE);
+  }
+# define AO_HAVE_int_or_acquire
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_int_xor_acquire(volatile unsigned *addr, unsigned value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_ACQUIRE);
+  }
+# define AO_HAVE_int_xor_acquire
+#endif
 /*
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
@@ -330,26 +372,32 @@ AO_fetch_and_add_acquire(volatile AO_t *addr, AO_t incr)
 }
 #define AO_HAVE_fetch_and_add_acquire
 
-AO_INLINE void
-AO_and_acquire(volatile AO_t *addr, AO_t value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_ACQUIRE);
-}
-#define AO_HAVE_and_acquire
-
-AO_INLINE void
-AO_or_acquire(volatile AO_t *addr, AO_t value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_ACQUIRE);
-}
-#define AO_HAVE_or_acquire
-
-AO_INLINE void
-AO_xor_acquire(volatile AO_t *addr, AO_t value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_ACQUIRE);
-}
-#define AO_HAVE_xor_acquire
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_and_acquire(volatile AO_t *addr, AO_t value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_ACQUIRE);
+  }
+# define AO_HAVE_and_acquire
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_or_acquire(volatile AO_t *addr, AO_t value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_ACQUIRE);
+  }
+# define AO_HAVE_or_acquire
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_xor_acquire(volatile AO_t *addr, AO_t value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_ACQUIRE);
+  }
+# define AO_HAVE_xor_acquire
+#endif
 /*
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
@@ -374,26 +422,32 @@ AO_char_fetch_and_add_release(volatile unsigned/**/char *addr, unsigned/**/char
 }
 #define AO_HAVE_char_fetch_and_add_release
 
-AO_INLINE void
-AO_char_and_release(volatile unsigned/**/char *addr, unsigned/**/char value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_RELEASE);
-}
-#define AO_HAVE_char_and_release
-
-AO_INLINE void
-AO_char_or_release(volatile unsigned/**/char *addr, unsigned/**/char value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_RELEASE);
-}
-#define AO_HAVE_char_or_release
-
-AO_INLINE void
-AO_char_xor_release(volatile unsigned/**/char *addr, unsigned/**/char value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_RELEASE);
-}
-#define AO_HAVE_char_xor_release
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_char_and_release(volatile unsigned/**/char *addr, unsigned/**/char value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_RELEASE);
+  }
+# define AO_HAVE_char_and_release
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_char_or_release(volatile unsigned/**/char *addr, unsigned/**/char value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_RELEASE);
+  }
+# define AO_HAVE_char_or_release
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_char_xor_release(volatile unsigned/**/char *addr, unsigned/**/char value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_RELEASE);
+  }
+# define AO_HAVE_char_xor_release
+#endif
 /*
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
@@ -418,26 +472,32 @@ AO_short_fetch_and_add_release(volatile unsigned/**/short *addr, unsigned/**/sho
 }
 #define AO_HAVE_short_fetch_and_add_release
 
-AO_INLINE void
-AO_short_and_release(volatile unsigned/**/short *addr, unsigned/**/short value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_RELEASE);
-}
-#define AO_HAVE_short_and_release
-
-AO_INLINE void
-AO_short_or_release(volatile unsigned/**/short *addr, unsigned/**/short value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_RELEASE);
-}
-#define AO_HAVE_short_or_release
-
-AO_INLINE void
-AO_short_xor_release(volatile unsigned/**/short *addr, unsigned/**/short value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_RELEASE);
-}
-#define AO_HAVE_short_xor_release
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_short_and_release(volatile unsigned/**/short *addr, unsigned/**/short value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_RELEASE);
+  }
+# define AO_HAVE_short_and_release
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_short_or_release(volatile unsigned/**/short *addr, unsigned/**/short value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_RELEASE);
+  }
+# define AO_HAVE_short_or_release
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_short_xor_release(volatile unsigned/**/short *addr, unsigned/**/short value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_RELEASE);
+  }
+# define AO_HAVE_short_xor_release
+#endif
 /*
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
@@ -462,26 +522,32 @@ AO_int_fetch_and_add_release(volatile unsigned *addr, unsigned incr)
 }
 #define AO_HAVE_int_fetch_and_add_release
 
-AO_INLINE void
-AO_int_and_release(volatile unsigned *addr, unsigned value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_RELEASE);
-}
-#define AO_HAVE_int_and_release
-
-AO_INLINE void
-AO_int_or_release(volatile unsigned *addr, unsigned value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_RELEASE);
-}
-#define AO_HAVE_int_or_release
-
-AO_INLINE void
-AO_int_xor_release(volatile unsigned *addr, unsigned value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_RELEASE);
-}
-#define AO_HAVE_int_xor_release
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_int_and_release(volatile unsigned *addr, unsigned value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_RELEASE);
+  }
+# define AO_HAVE_int_and_release
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_int_or_release(volatile unsigned *addr, unsigned value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_RELEASE);
+  }
+# define AO_HAVE_int_or_release
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_int_xor_release(volatile unsigned *addr, unsigned value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_RELEASE);
+  }
+# define AO_HAVE_int_xor_release
+#endif
 /*
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
@@ -506,26 +572,32 @@ AO_fetch_and_add_release(volatile AO_t *addr, AO_t incr)
 }
 #define AO_HAVE_fetch_and_add_release
 
-AO_INLINE void
-AO_and_release(volatile AO_t *addr, AO_t value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_RELEASE);
-}
-#define AO_HAVE_and_release
-
-AO_INLINE void
-AO_or_release(volatile AO_t *addr, AO_t value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_RELEASE);
-}
-#define AO_HAVE_or_release
-
-AO_INLINE void
-AO_xor_release(volatile AO_t *addr, AO_t value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_RELEASE);
-}
-#define AO_HAVE_xor_release
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_and_release(volatile AO_t *addr, AO_t value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_RELEASE);
+  }
+# define AO_HAVE_and_release
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_or_release(volatile AO_t *addr, AO_t value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_RELEASE);
+  }
+# define AO_HAVE_or_release
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_xor_release(volatile AO_t *addr, AO_t value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_RELEASE);
+  }
+# define AO_HAVE_xor_release
+#endif
 /*
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
@@ -550,26 +622,32 @@ AO_char_fetch_and_add_full(volatile unsigned/**/char *addr, unsigned/**/char inc
 }
 #define AO_HAVE_char_fetch_and_add_full
 
-AO_INLINE void
-AO_char_and_full(volatile unsigned/**/char *addr, unsigned/**/char value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_SEQ_CST);
-}
-#define AO_HAVE_char_and_full
-
-AO_INLINE void
-AO_char_or_full(volatile unsigned/**/char *addr, unsigned/**/char value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_SEQ_CST);
-}
-#define AO_HAVE_char_or_full
-
-AO_INLINE void
-AO_char_xor_full(volatile unsigned/**/char *addr, unsigned/**/char value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_SEQ_CST);
-}
-#define AO_HAVE_char_xor_full
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_char_and_full(volatile unsigned/**/char *addr, unsigned/**/char value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_SEQ_CST);
+  }
+# define AO_HAVE_char_and_full
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_char_or_full(volatile unsigned/**/char *addr, unsigned/**/char value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_SEQ_CST);
+  }
+# define AO_HAVE_char_or_full
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_char_xor_full(volatile unsigned/**/char *addr, unsigned/**/char value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_SEQ_CST);
+  }
+# define AO_HAVE_char_xor_full
+#endif
 /*
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
@@ -594,26 +672,32 @@ AO_short_fetch_and_add_full(volatile unsigned/**/short *addr, unsigned/**/short
 }
 #define AO_HAVE_short_fetch_and_add_full
 
-AO_INLINE void
-AO_short_and_full(volatile unsigned/**/short *addr, unsigned/**/short value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_SEQ_CST);
-}
-#define AO_HAVE_short_and_full
-
-AO_INLINE void
-AO_short_or_full(volatile unsigned/**/short *addr, unsigned/**/short value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_SEQ_CST);
-}
-#define AO_HAVE_short_or_full
-
-AO_INLINE void
-AO_short_xor_full(volatile unsigned/**/short *addr, unsigned/**/short value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_SEQ_CST);
-}
-#define AO_HAVE_short_xor_full
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_short_and_full(volatile unsigned/**/short *addr, unsigned/**/short value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_SEQ_CST);
+  }
+# define AO_HAVE_short_and_full
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_short_or_full(volatile unsigned/**/short *addr, unsigned/**/short value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_SEQ_CST);
+  }
+# define AO_HAVE_short_or_full
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_short_xor_full(volatile unsigned/**/short *addr, unsigned/**/short value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_SEQ_CST);
+  }
+# define AO_HAVE_short_xor_full
+#endif
 /*
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
@@ -638,26 +722,32 @@ AO_int_fetch_and_add_full(volatile unsigned *addr, unsigned incr)
 }
 #define AO_HAVE_int_fetch_and_add_full
 
-AO_INLINE void
-AO_int_and_full(volatile unsigned *addr, unsigned value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_SEQ_CST);
-}
-#define AO_HAVE_int_and_full
-
-AO_INLINE void
-AO_int_or_full(volatile unsigned *addr, unsigned value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_SEQ_CST);
-}
-#define AO_HAVE_int_or_full
-
-AO_INLINE void
-AO_int_xor_full(volatile unsigned *addr, unsigned value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_SEQ_CST);
-}
-#define AO_HAVE_int_xor_full
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_int_and_full(volatile unsigned *addr, unsigned value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_SEQ_CST);
+  }
+# define AO_HAVE_int_and_full
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_int_or_full(volatile unsigned *addr, unsigned value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_SEQ_CST);
+  }
+# define AO_HAVE_int_or_full
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_int_xor_full(volatile unsigned *addr, unsigned value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_SEQ_CST);
+  }
+# define AO_HAVE_int_xor_full
+#endif
 /*
  * Copyright (c) 1991-1994 by Xerox Corporation.  All rights reserved.
  * Copyright (c) 1996-1999 by Silicon Graphics.  All rights reserved.
@@ -682,23 +772,29 @@ AO_fetch_and_add_full(volatile AO_t *addr, AO_t incr)
 }
 #define AO_HAVE_fetch_and_add_full
 
-AO_INLINE void
-AO_and_full(volatile AO_t *addr, AO_t value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_SEQ_CST);
-}
-#define AO_HAVE_and_full
-
-AO_INLINE void
-AO_or_full(volatile AO_t *addr, AO_t value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_SEQ_CST);
-}
-#define AO_HAVE_or_full
-
-AO_INLINE void
-AO_xor_full(volatile AO_t *addr, AO_t value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_SEQ_CST);
-}
-#define AO_HAVE_xor_full
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_and_full(volatile AO_t *addr, AO_t value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_SEQ_CST);
+  }
+# define AO_HAVE_and_full
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_or_full(volatile AO_t *addr, AO_t value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_SEQ_CST);
+  }
+# define AO_HAVE_or_full
+#endif
+
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_xor_full(volatile AO_t *addr, AO_t value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_SEQ_CST);
+  }
+# define AO_HAVE_xor_full
+#endif
index 2067d5540bb67511d27f7caf4bb06b92f519a7a0..41e56bfc779b7147b9736e91aaf3322c776982cd 100644 (file)
@@ -22,23 +22,29 @@ AO_XSIZE_fetch_and_add_XBAR(volatile XCTYPE *addr, XCTYPE incr)
 }
 #define AO_HAVE_XSIZE_fetch_and_add_XBAR
 
-AO_INLINE void
-AO_XSIZE_and_XBAR(volatile XCTYPE *addr, XCTYPE value)
-{
-  (void)__atomic_and_fetch(addr, value, __ATOMIC_XGCCBAR);
-}
-#define AO_HAVE_XSIZE_and_XBAR
+#ifndef AO_SKIPATOMIC_ANY_and_ANY
+  AO_INLINE void
+  AO_XSIZE_and_XBAR(volatile XCTYPE *addr, XCTYPE value)
+  {
+    (void)__atomic_and_fetch(addr, value, __ATOMIC_XGCCBAR);
+  }
+# define AO_HAVE_XSIZE_and_XBAR
+#endif
 
-AO_INLINE void
-AO_XSIZE_or_XBAR(volatile XCTYPE *addr, XCTYPE value)
-{
-  (void)__atomic_or_fetch(addr, value, __ATOMIC_XGCCBAR);
-}
-#define AO_HAVE_XSIZE_or_XBAR
+#ifndef AO_SKIPATOMIC_ANY_or_ANY
+  AO_INLINE void
+  AO_XSIZE_or_XBAR(volatile XCTYPE *addr, XCTYPE value)
+  {
+    (void)__atomic_or_fetch(addr, value, __ATOMIC_XGCCBAR);
+  }
+# define AO_HAVE_XSIZE_or_XBAR
+#endif
 
-AO_INLINE void
-AO_XSIZE_xor_XBAR(volatile XCTYPE *addr, XCTYPE value)
-{
-  (void)__atomic_xor_fetch(addr, value, __ATOMIC_XGCCBAR);
-}
-#define AO_HAVE_XSIZE_xor_XBAR
+#ifndef AO_SKIPATOMIC_ANY_xor_ANY
+  AO_INLINE void
+  AO_XSIZE_xor_XBAR(volatile XCTYPE *addr, XCTYPE value)
+  {
+    (void)__atomic_xor_fetch(addr, value, __ATOMIC_XGCCBAR);
+  }
+# define AO_HAVE_XSIZE_xor_XBAR
+#endif