[PATCH 08/22] x86: Remove ununsed atomic macros

Uros Bizjak ubizjak@gmail.com
Thu Sep 11 14:59:42 GMT 2025


On Thu, Sep 11, 2025 at 3:52 PM Adhemerval Zanella
<adhemerval.zanella@linaro.org> wrote:
>
> These are already provided by the generic include/atomic.h.
> ---
>  sysdeps/x86/atomic-machine.h | 25 -------------------------
>  1 file changed, 25 deletions(-)
>
> diff --git a/sysdeps/x86/atomic-machine.h b/sysdeps/x86/atomic-machine.h
> index d055364ddd..1a963fea2f 100644
> --- a/sysdeps/x86/atomic-machine.h
> +++ b/sysdeps/x86/atomic-machine.h
> @@ -19,8 +19,6 @@
>  #ifndef _X86_ATOMIC_MACHINE_H
>  #define _X86_ATOMIC_MACHINE_H 1
>
> -#define USE_ATOMIC_COMPILER_BUILTINS   1
> -
>  #ifdef __x86_64__
>  # define __HAVE_64B_ATOMICS            1
>  #else
> @@ -33,29 +31,6 @@
>
>  #define ATOMIC_EXCHANGE_USES_CAS       0
>
> -#define atomic_compare_and_exchange_val_acq(mem, newval, oldval)       \
> -  ({                                                                   \
> -    typeof (*mem) __oldval = (oldval);                                 \
> -    __atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,   \
> -                                __ATOMIC_ACQUIRE, __ATOMIC_RELAXED);   \
> -    __oldval;                                                          \
> -  })
> -
> -#define atomic_compare_and_exchange_bool_acq(mem, newval, oldval)      \
> -  ({                                                                   \
> -    typeof (*mem) __oldval = (oldval);                                 \
> -    !__atomic_compare_exchange_n (mem, (void *) &__oldval, newval, 0,  \
> -                                 __ATOMIC_ACQUIRE, __ATOMIC_RELAXED);  \
> -  })
> -
> -#define atomic_exchange_acq(mem, newvalue) \
> -  __atomic_exchange_n (mem, newvalue, __ATOMIC_ACQUIRE)
> -
> -/* ??? Remove when catomic_exchange_and_add
> -   fallback uses __atomic_fetch_add.  */
> -#define catomic_exchange_and_add(mem, value) \
> -  __atomic_fetch_add (mem, value, __ATOMIC_ACQUIRE)
> -
>  #define atomic_full_barrier() __sync_synchronize ()
>  #define atomic_read_barrier() __asm ("" ::: "memory")
>  #define atomic_write_barrier() __asm ("" ::: "memory")

I have compiled glibc w/ and w/o your patch. There were no differences
and sha1sum matched between old and new libc.so.

Reviewed-by: Uros Bizjak <ubizjak@gmail.com>


More information about the Libc-alpha mailing list