]> granicus.if.org Git - libatomic_ops/commitdiff
Use generalized double-wide load/store if AO_PREFER_GENERALIZED (gcc/x86)
authorIvan Maidanski <ivmai@mail.ru>
Fri, 27 Jan 2017 16:46:07 +0000 (19:46 +0300)
committerIvan Maidanski <ivmai@mail.ru>
Fri, 27 Jan 2017 16:46:07 +0000 (19:46 +0300)
* src/atomic_ops/sysdeps/gcc/x86.h [!__x86_64__ || __ILP32__]: Do not
include double_atomic_load_store.h if AO_PREFER_GENERALIZED.

src/atomic_ops/sysdeps/gcc/x86.h

index e38f5ca88a945d4d0ad1cc44919567f30f432a4c..5fb390217188a4cd81c39489f4cfd4ffbf750b4d 100644 (file)
@@ -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).              */