|
@@ -1,16 +1,29 @@
|
|
dnl This test is taken from libgfortran
|
|
dnl This test is taken from libgfortran
|
|
|
|
|
|
-dnl Check whether the target supports __sync_*_compare_and_swap.
|
|
|
|
-AC_DEFUN([STARPU_CHECK_SYNC_BUILTINS], [
|
|
|
|
- AC_CACHE_CHECK([whether the target supports __sync_*_compare_and_swap],
|
|
|
|
- ac_cv_have_sync_builtins, [
|
|
|
|
|
|
+dnl Check whether the target supports __sync_val_compare_and_swap.
|
|
|
|
+AC_DEFUN([STARPU_CHECK_SYNC_VAL_COMPARE_SWAP], [
|
|
|
|
+ AC_CACHE_CHECK([whether the target supports __sync_val_compare_and_swap],
|
|
|
|
+ ac_cv_have_sync_val_compare_and_swap, [
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([int foo, bar;],
|
|
AC_LINK_IFELSE([AC_LANG_PROGRAM([int foo, bar;],
|
|
[bar = __sync_val_compare_and_swap(&foo, 0, 1);])],
|
|
[bar = __sync_val_compare_and_swap(&foo, 0, 1);])],
|
|
- [ac_cv_have_sync_builtins=yes],
|
|
|
|
- [ac_cv_have_sync_builtins=no])])
|
|
|
|
- if test $ac_cv_have_sync_builtins = yes; then
|
|
|
|
- AC_DEFINE(STARPU_HAVE_SYNC_BUILTINS, 1,
|
|
|
|
- [Define to 1 if the target supports __sync_*_compare_and_swap])
|
|
|
|
|
|
+ [ac_cv_have_sync_val_compare_and_swap=yes],
|
|
|
|
+ [ac_cv_have_sync_val_compare_and_swap=no])])
|
|
|
|
+ if test $ac_cv_have_sync_val_compare_and_swap = yes; then
|
|
|
|
+ AC_DEFINE(STARPU_HAVE_SYNC_VAL_COMPARE_SWAP, 1,
|
|
|
|
+ [Define to 1 if the target supports __sync_val_compare_and_swap])
|
|
|
|
+ fi])
|
|
|
|
+
|
|
|
|
+dnl Check whether the target supports __sync_bool_compare_and_swap.
|
|
|
|
+AC_DEFUN([STARPU_CHECK_SYNC_BOOL_COMPARE_AND_SWAP], [
|
|
|
|
+ AC_CACHE_CHECK([whether the target supports __sync_bool_compare_and_swap],
|
|
|
|
+ ac_cv_have_sync_bool_compare_and_swap, [
|
|
|
|
+ AC_LINK_IFELSE([AC_LANG_PROGRAM([int foo, bar;],
|
|
|
|
+ [bar = __sync_bool_compare_and_swap(&foo, 0, 1);])],
|
|
|
|
+ [ac_cv_have_sync_bool_compare_and_swap=yes],
|
|
|
|
+ [ac_cv_have_sync_bool_compare_and_swap=no])])
|
|
|
|
+ if test $ac_cv_have_sync_bool_compare_and_swap = yes; then
|
|
|
|
+ AC_DEFINE(STARPU_HAVE_SYNC_BOOL_COMPARE_AND_SWAP, 1,
|
|
|
|
+ [Define to 1 if the target supports __sync_bool_compare_and_swap])
|
|
fi])
|
|
fi])
|
|
|
|
|
|
dnl Check whether the target supports __sync_fetch_and_add.
|
|
dnl Check whether the target supports __sync_fetch_and_add.
|
|
@@ -51,3 +64,16 @@ AC_DEFUN([STARPU_CHECK_SYNC_LOCK_TEST_AND_SET], [
|
|
AC_DEFINE(STARPU_HAVE_SYNC_LOCK_TEST_AND_SET, 1,
|
|
AC_DEFINE(STARPU_HAVE_SYNC_LOCK_TEST_AND_SET, 1,
|
|
[Define to 1 if the target supports __sync_lock_test_and_set])
|
|
[Define to 1 if the target supports __sync_lock_test_and_set])
|
|
fi])
|
|
fi])
|
|
|
|
+
|
|
|
|
+dnl Check whether the target supports __sync_synchronize.
|
|
|
|
+AC_DEFUN([STARPU_CHECK_SYNC_SYNCHRONIZE], [
|
|
|
|
+ AC_CACHE_CHECK([whether the target supports __sync_synchronize],
|
|
|
|
+ ac_cv_have_sync_synchronize, [
|
|
|
|
+ AC_LINK_IFELSE([AC_LANG_PROGRAM(,
|
|
|
|
+ [__sync_synchronize();])],
|
|
|
|
+ [ac_cv_have_sync_synchronize=yes],
|
|
|
|
+ [ac_cv_have_sync_synchronize=no])])
|
|
|
|
+ if test $ac_cv_have_sync_synchronize = yes; then
|
|
|
|
+ AC_DEFINE(STARPU_HAVE_SYNC_SYNCHRONIZE, 1,
|
|
|
|
+ [Define to 1 if the target supports __sync_synchronize])
|
|
|
|
+ fi])
|