1111 * Copyright (c) 2004-2005 The Regents of the University of California.
1212 * All rights reserved.
1313 * Copyright (c) 2011 Sandia National Laboratories. All rights reserved.
14- * Copyright (c) 2014 Los Alamos National Security, LLC. All rights
14+ * Copyright (c) 2014-2016 Los Alamos National Security, LLC. All rights
1515 * reserved.
1616 * $COPYRIGHT$
1717 *
@@ -86,6 +86,8 @@ static inline int32_t opal_atomic_sub_32(volatile int32_t *addr, int32_t delta)
8686 return __sync_sub_and_fetch (addr , delta );
8787}
8888
89+ #if OPAL_ASM_SYNC_HAVE_64BIT
90+
8991#define OPAL_HAVE_ATOMIC_CMPSET_64 1
9092static inline int opal_atomic_cmpset_acq_64 ( volatile int64_t * addr ,
9193 int64_t oldval , int64_t newval )
@@ -105,17 +107,6 @@ static inline int opal_atomic_cmpset_64( volatile int64_t *addr,
105107 return __sync_bool_compare_and_swap (addr , oldval , newval );
106108}
107109
108- #if OPAL_HAVE_SYNC_BUILTIN_CSWAP_INT128
109- static inline int opal_atomic_cmpset_128 (volatile opal_int128_t * addr ,
110- opal_int128_t oldval , opal_int128_t newval )
111- {
112- return __sync_bool_compare_and_swap (addr , oldval , newval );
113- }
114-
115- #define OPAL_HAVE_ATOMIC_CMPSET_128 1
116-
117- #endif
118-
119110#define OPAL_HAVE_ATOMIC_MATH_64 1
120111#define OPAL_HAVE_ATOMIC_ADD_64 1
121112static inline int64_t opal_atomic_add_64 (volatile int64_t * addr , int64_t delta )
@@ -129,4 +120,17 @@ static inline int64_t opal_atomic_sub_64(volatile int64_t *addr, int64_t delta)
129120 return __sync_sub_and_fetch (addr , delta );
130121}
131122
123+ #endif
124+
125+ #if OPAL_HAVE_SYNC_BUILTIN_CSWAP_INT128
126+ static inline int opal_atomic_cmpset_128 (volatile opal_int128_t * addr ,
127+ opal_int128_t oldval , opal_int128_t newval )
128+ {
129+ return __sync_bool_compare_and_swap (addr , oldval , newval );
130+ }
131+
132+ #define OPAL_HAVE_ATOMIC_CMPSET_128 1
133+
134+ #endif
135+
132136#endif /* ! OPAL_SYS_ARCH_ATOMIC_H */
0 commit comments