+2012-08-13 Maxim Kuvyrkov <maxim@codesourcery.com>
+
+ [__GNUC_PREREQ (4, 8)]
+ (atomic_exchange_and_add): Split into ...
+ (atomic_exchange_and_add_acq, atomic_exchange_and_add_rel): ... these.
+ New atomic macros.
+ [!__GNUC_PREREQ (4, 8)]
+ (atomic_exchange_and_add): Split into ...
+ (atomic_exchange_and_add_acq, atomic_exchange_and_add_rel): ... these.
+ New atomic macros.
+
2012-08-09 Joseph Myers <joseph@codesourcery.com>
* sysdeps/unix/sysv/linux/mips/kernel-features.h
__atomic_fetch_add (mem, value, model)
# endif
-/* ??? Barrier semantics for atomic_exchange_and_add appear to be
- undefined. Use full barrier for now, as that's safe. */
-# define atomic_exchange_and_add(mem, value) \
+# define atomic_exchange_and_add_acq(mem, value) \
__atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \
- __ATOMIC_ACQ_REL)
+ __ATOMIC_ACQUIRE)
+
+# define atomic_exchange_and_add_rel(mem, value) \
+ __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \
+ __ATOMIC_RELEASE)
#else /* !__GNUC_PREREQ (4, 8) */
/* This implementation using inline assembly will be removed once glibc
requires GCC 4.8 or later to build. */
__prev; })
# endif
-/* ??? Barrier semantics for atomic_exchange_and_add appear to be
- undefined. Use full barrier for now, as that's safe. */
-# define atomic_exchange_and_add(mem, value) \
- __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \
- MIPS_SYNC_STR, MIPS_SYNC_STR)
+# define atomic_exchange_and_add_acq(mem, value) \
+ __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \
+ "", MIPS_SYNC_STR)
+
+# define atomic_exchange_and_add_rel(mem, value) \
+ __atomic_val_bysize (__arch_exchange_and_add, int, mem, value, \
+ MIPS_SYNC_STR, "")
#endif /* __GNUC_PREREQ (4, 8) */
/* TODO: More atomic operations could be implemented efficiently; only the