From: Ivan Maidanski Date: Fri, 27 Jan 2017 16:46:07 +0000 (+0300) Subject: Use generalized double-wide load/store if AO_PREFER_GENERALIZED (gcc/x86) X-Git-Tag: v7.6.0~111 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e70e86404d1d7c188dcd5ca4d94e678b5fe57b2d;p=libatomic_ops Use generalized double-wide load/store if AO_PREFER_GENERALIZED (gcc/x86) * src/atomic_ops/sysdeps/gcc/x86.h [!__x86_64__ || __ILP32__]: Do not include double_atomic_load_store.h if AO_PREFER_GENERALIZED. --- diff --git a/src/atomic_ops/sysdeps/gcc/x86.h b/src/atomic_ops/sysdeps/gcc/x86.h index e38f5ca..5fb3902 100644 --- a/src/atomic_ops/sysdeps/gcc/x86.h +++ b/src/atomic_ops/sysdeps/gcc/x86.h @@ -411,8 +411,10 @@ AO_fetch_compare_and_swap_full(volatile AO_t *addr, AO_t old_val, /* Reading or writing a quadword aligned on a 64-bit boundary is */ /* always carried out atomically on at least a Pentium according to */ /* Chapter 8.1.1 of Volume 3A Part 1 of Intel processor manuals. */ -# define AO_ACCESS_double_CHECK_ALIGNED -# include "../loadstore/double_atomic_load_store.h" +# ifndef AO_PREFER_GENERALIZED +# define AO_ACCESS_double_CHECK_ALIGNED +# include "../loadstore/double_atomic_load_store.h" +# endif /* Returns nonzero if the comparison succeeded. */ /* Really requires at least a Pentium. */ @@ -481,8 +483,10 @@ AO_fetch_compare_and_swap_full(volatile AO_t *addr, AO_t old_val, /* Reading or writing a quadword aligned on a 64-bit boundary is */ /* always carried out atomically (requires at least a Pentium). */ -# define AO_ACCESS_double_CHECK_ALIGNED -# include "../loadstore/double_atomic_load_store.h" +# ifndef AO_PREFER_GENERALIZED +# define AO_ACCESS_double_CHECK_ALIGNED +# include "../loadstore/double_atomic_load_store.h" +# endif /* X32 has native support for 64-bit integer operations (AO_double_t */ /* is a 64-bit integer and we could use 64-bit cmpxchg). */