1
1

opal/asm: fall back on inline asm atomics in some cases

This commit changes the asm configure logic to fall back on inline asm
atomics on systems that 1) have __sync atomics, 2) do not have 64-bit
__sync atomics, and 3) support 64-bit asm.

Signed-off-by: Nathan Hjelm <hjelmn@me.com>
Этот коммит содержится в:
Nathan Hjelm 2016-05-10 04:15:26 -06:00
родитель d99a9786b6
Коммит b2f33bc076

Просмотреть файл

@ -110,6 +110,9 @@ __sync_add_and_fetch(&tmp, 1);],
AC_DEFINE_UNQUOTED([OPAL_ASM_SYNC_HAVE_64BIT],[$opal_asm_sync_have_64bit],
[Whether 64-bit is supported by the __sync builtin atomics])
# Check for 128-bit support
OPAL_CHECK_SYNC_BUILTIN_CSWAP_INT128
])
@ -893,7 +896,6 @@ AC_DEFUN([OPAL_CONFIG_ASM],[
opal_cv_asm_builtin="BUILTIN_NO"
if test "$opal_cv_asm_builtin" = "BUILTIN_NO" && test "$enable_builtin_atomics" = "yes" ; then
OPAL_CHECK_SYNC_BUILTINS([opal_cv_asm_builtin="BUILTIN_SYNC"], [])
OPAL_CHECK_SYNC_BUILTIN_CSWAP_INT128
fi
if test "$opal_cv_asm_builtin" = "BUILTIN_NO" && test "$enable_osx_builtin_atomics" = "yes" ; then
AC_CHECK_HEADER([libkern/OSAtomic.h],
@ -1024,6 +1026,12 @@ AC_MSG_ERROR([Can not continue.])
;;
esac
if test "x$OPAL_ASM_SUPPORT_64BIT" = "x1" && test "$opal_cv_asm_builtin" = "BUILTIN_SYNC" &&
test "$opal_asm_sync_have_64bit" = "0" ; then
# __sync builtins exist but do not implement 64-bit support. Fall back on inline asm.
opal_cv_asm_builtin="BUILTIN_NO"
fi
if test "$opal_cv_asm_builtin" = "BUILTIN_SYNC" ; then
AC_DEFINE([OPAL_C_GCC_INLINE_ASSEMBLY], [1],
[Whether C compiler supports GCC style inline assembly])