11
11
* Copyright (c) 2004-2005 The Regents of the University of California.
12
12
* All rights reserved.
13
13
* 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
15
15
* reserved.
16
16
* $COPYRIGHT$
17
17
*
@@ -86,6 +86,8 @@ static inline int32_t opal_atomic_sub_32(volatile int32_t *addr, int32_t delta)
86
86
return __sync_sub_and_fetch (addr , delta );
87
87
}
88
88
89
+ #if OPAL_ASM_SYNC_HAVE_64BIT
90
+
89
91
#define OPAL_HAVE_ATOMIC_CMPSET_64 1
90
92
static inline int opal_atomic_cmpset_acq_64 ( volatile int64_t * addr ,
91
93
int64_t oldval , int64_t newval )
@@ -105,17 +107,6 @@ static inline int opal_atomic_cmpset_64( volatile int64_t *addr,
105
107
return __sync_bool_compare_and_swap (addr , oldval , newval );
106
108
}
107
109
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
-
119
110
#define OPAL_HAVE_ATOMIC_MATH_64 1
120
111
#define OPAL_HAVE_ATOMIC_ADD_64 1
121
112
static 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)
129
120
return __sync_sub_and_fetch (addr , delta );
130
121
}
131
122
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
+
132
136
#endif /* ! OPAL_SYS_ARCH_ATOMIC_H */
0 commit comments