@@ -193,14 +193,23 @@ AC_DEFUN([OPAL_CHECK_GCC_BUILTIN_CSWAP_INT128], [
193193AC_DEFUN ( [ OPAL_CHECK_GCC_ATOMIC_BUILTINS] , [
194194 AC_MSG_CHECKING ( [ for __atomic builtin atomics] )
195195
196- AC_TRY_LINK ( [ long tmp, old = 0;] , [ __atomic_thread_fence(__ATOMIC_SEQ_CST);
196+ AC_TRY_LINK ( [
197+ #include <stdint.h>
198+ uint32_t tmp, old = 0;
199+ uint64_t tmp64, old64 = 0;] , [
200+ __atomic_thread_fence(__ATOMIC_SEQ_CST);
197201__atomic_compare_exchange_n(&tmp, &old, 1, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
198- __atomic_add_fetch(&tmp, 1, __ATOMIC_RELAXED);] ,
202+ __atomic_add_fetch(&tmp, 1, __ATOMIC_RELAXED);
203+ __atomic_compare_exchange_n(&tmp64, &old64, 1, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED);
204+ __atomic_add_fetch(&tmp64, 1, __ATOMIC_RELAXED);] ,
199205 [ AC_MSG_RESULT ( [ yes] )
200206 $1 ] ,
201207 [ AC_MSG_RESULT ( [ no] )
202208 $2 ] )
203209
210+ AC_DEFINE_UNQUOTED ( [ OPAL_ASM_SYNC_HAVE_64BIT] ,[ $opal_asm_sync_have_64bit] ,
211+ [ Whether 64-bit is supported by the __sync builtin atomics] )
212+
204213 # Check for 128-bit support
205214 OPAL_CHECK_GCC_BUILTIN_CSWAP_INT128
206215] )
0 commit comments