Generalize acquire/release/full CAS primitives for MIPS
authorIvan Maidanski <ivmai@mail.ru>
Tue, 29 Nov 2011 17:46:44 +0000 (21:46 +0400)
committerIvan Maidanski <ivmai@mail.ru>
Tue, 29 Nov 2011 17:46:44 +0000 (21:46 +0400)
* src/atomic_ops/sysdeps/gcc/mips.h (AO_compare_and_swap_acquire,
AO_compare_and_swap_release, AO_compare_and_swap_full): Remove as
generalized; add comment.

src/atomic_ops/sysdeps/gcc/mips.h

index 13923f7..670e30e 100644 (file)
@@ -66,33 +66,9 @@ AO_compare_and_swap(volatile AO_t *addr, AO_t old, AO_t new_val)
 }
 #define AO_HAVE_compare_and_swap
 
-/* FIXME: I think the implementations below should be automatically     */
-/* generated if we omit them.  - HB                                     */
-
-AO_INLINE int
-AO_compare_and_swap_acquire(volatile AO_t *addr, AO_t old, AO_t new_val) {
-  int result = AO_compare_and_swap(addr, old, new_val);
-  AO_nop_full();
-  return result;
-}
-#define AO_HAVE_compare_and_swap_acquire
-
-AO_INLINE int
-AO_compare_and_swap_release(volatile AO_t *addr, AO_t old, AO_t new_val) {
-  AO_nop_full();
-  return AO_compare_and_swap(addr, old, new_val);
-}
-#define AO_HAVE_compare_and_swap_release
-
-AO_INLINE int
-AO_compare_and_swap_full(volatile AO_t *addr, AO_t old, AO_t new_val) {
-  int result;
-  AO_nop_full();
-  result = AO_compare_and_swap(addr, old, new_val);
-  AO_nop_full();
-  return result;
-}
-#define AO_HAVE_compare_and_swap_full
+/* CAS primitives with acquire, release and full semantics are  */
+/* generated automatically (and AO_int_... primitives are       */
+/* defined properly after the first generalization pass).       */
 
 /*
  * FIXME: We should also implement fetch_and_add and or primitives