diff mbox series

[3/4] Remove old atomics defines from include/atomics.h

Message ID AM5PR0801MB1668CA39B576F7AB7C79DBEE838F9@AM5PR0801MB1668.eurprd08.prod.outlook.com
State New
Headers show
Series [1/4] Switch to builtin atomics | expand

Commit Message

Wilco Dijkstra July 19, 2022, 2:14 p.m. UTC
Since they are no longer used, remove various old atomics from include/atomics.h.

---
diff mbox series

Patch

diff --git a/include/atomic.h b/include/atomic.h
index e59e210e83fa301f48c4cdb3676d37e4980cc4a2..40ad43346d3c5f27dac72b72cd8fe6612a4f11cd 100644
--- a/include/atomic.h
+++ b/include/atomic.h
@@ -104,60 +104,6 @@ 
   })
 
 
-/* Store NEWVALUE in *MEM and return the old value.  */
-#ifndef atomic_exchange_acq
-# define atomic_exchange_acq(mem, newvalue) \
-  ({ __typeof ((__typeof (*(mem))) *(mem)) __atg5_oldval;		      \
-     __typeof (mem) __atg5_memp = (mem);				      \
-     __typeof ((__typeof (*(mem))) *(mem)) __atg5_value = (newvalue);	      \
-									      \
-     do									      \
-       __atg5_oldval = *__atg5_memp;					      \
-     while (__builtin_expect						      \
-	    (atomic_compare_and_exchange_bool_acq (__atg5_memp, __atg5_value, \
-						   __atg5_oldval), 0));	      \
-									      \
-     __atg5_oldval; })
-#endif
-
-#ifndef atomic_exchange_rel
-# define atomic_exchange_rel(mem, newvalue) atomic_exchange_acq (mem, newvalue)
-#endif
-
-
-/* Add VALUE to *MEM and return the old value of *MEM.  */
-#ifndef atomic_exchange_and_add_acq
-# ifdef atomic_exchange_and_add
-#  define atomic_exchange_and_add_acq(mem, value) \
-  atomic_exchange_and_add (mem, value)
-# else
-#  define atomic_exchange_and_add_acq(mem, value) \
-  ({ __typeof (*(mem)) __atg6_oldval;					      \
-     __typeof (mem) __atg6_memp = (mem);				      \
-     __typeof (*(mem)) __atg6_value = (value);				      \
-									      \
-     do									      \
-       __atg6_oldval = *__atg6_memp;					      \
-     while (__builtin_expect						      \
-	    (atomic_compare_and_exchange_bool_acq (__atg6_memp,		      \
-						   __atg6_oldval	      \
-						   + __atg6_value,	      \
-						   __atg6_oldval), 0));	      \
-									      \
-     __atg6_oldval; })
-# endif
-#endif
-
-#ifndef atomic_exchange_and_add_rel
-# define atomic_exchange_and_add_rel(mem, value) \
-  atomic_exchange_and_add_acq(mem, value)
-#endif
-
-#ifndef atomic_exchange_and_add
-# define atomic_exchange_and_add(mem, value) \
-  atomic_exchange_and_add_acq(mem, value)
-#endif
-
 #ifndef atomic_max_relaxed
 # define atomic_max_relaxed(mem, value) \
   do {									      \
@@ -196,40 +142,6 @@ 
 #endif
 
 
-/* Atomically *mem &= mask and return the old value of *mem.  */
-#ifndef atomic_and_val
-# define atomic_and_val(mem, mask) \
-  ({ __typeof (*(mem)) __atg16_old;					      \
-     __typeof (mem) __atg16_memp = (mem);				      \
-     __typeof (*(mem)) __atg16_mask = (mask);				      \
-									      \
-     do									      \
-       __atg16_old = (*__atg16_memp);					      \
-     while (__builtin_expect						      \
-	    (atomic_compare_and_exchange_bool_acq (__atg16_memp,	      \
-						   __atg16_old & __atg16_mask,\
-						   __atg16_old), 0));	      \
-									      \
-     __atg16_old; })
-#endif
-
-/* Atomically *mem |= mask and return the old value of *mem.  */
-#ifndef atomic_or_val
-# define atomic_or_val(mem, mask) \
-  ({ __typeof (*(mem)) __atg19_old;					      \
-     __typeof (mem) __atg19_memp = (mem);				      \
-     __typeof (*(mem)) __atg19_mask = (mask);				      \
-									      \
-     do									      \
-       __atg19_old = (*__atg19_memp);					      \
-     while (__builtin_expect						      \
-	    (atomic_compare_and_exchange_bool_acq (__atg19_memp,	      \
-						   __atg19_old | __atg19_mask,\
-						   __atg19_old), 0));	      \
-									      \
-     __atg19_old; })
-#endif
-
 #ifndef atomic_full_barrier
 # define atomic_full_barrier() __asm ("" ::: "memory")
 #endif