summaryrefslogtreecommitdiff
path: root/libgo/configure.ac
diff options
context:
space:
mode:
authorian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-12 06:23:08 +0000
committerian <ian@138bc75d-0d04-0410-961f-82ee72b054a4>2012-02-12 06:23:08 +0000
commit97a9e84db7393685db4d56f134fc73ee94c0995e (patch)
treed088dbdf76ccf89230dc607d000488ace3bb43e9 /libgo/configure.ac
parent9116c6038a9c15eae91de1dd8ddb75f22656cce5 (diff)
downloadgcc-97a9e84db7393685db4d56f134fc73ee94c0995e.tar.gz
PR go/52084
libgo: Provide more __sync functions if required. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@184138 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/configure.ac')
-rw-r--r--libgo/configure.ac28
1 files changed, 28 insertions, 0 deletions
diff --git a/libgo/configure.ac b/libgo/configure.ac
index 9c8478de74f..c3c1f5e9452 100644
--- a/libgo/configure.ac
+++ b/libgo/configure.ac
@@ -497,6 +497,20 @@ if test "$libgo_cv_func___sync_bool_compare_and_swap_4" = "yes"; then
[Define to 1 if the compiler provides the __sync_bool_compare_and_swap function for uint32])
fi
+AC_CACHE_CHECK([for __sync_bool_compare_and_swap_8],
+[libgo_cv_func___sync_bool_compare_and_swap_8],
+[AC_LINK_IFELSE([
+typedef unsigned int uint64 __attribute__ ((mode (DI)));
+uint64 i;
+int main() { return __sync_bool_compare_and_swap (&i, 0, 1); }
+],
+[libgo_cv_func___sync_bool_compare_and_swap_8=yes],
+[libgo_cv_func___sync_bool_compare_and_swap_8=no])])
+if test "$libgo_cv_func___sync_bool_compare_and_swap_8" = "yes"; then
+ AC_DEFINE(HAVE_SYNC_BOOL_COMPARE_AND_SWAP_8, 1,
+ [Define to 1 if the compiler provides the __sync_bool_compare_and_swap function for uint64])
+fi
+
AC_CACHE_CHECK([for __sync_fetch_and_add_4],
[libgo_cv_func___sync_fetch_and_add_4],
[AC_LINK_IFELSE([
@@ -511,6 +525,20 @@ if test "$libgo_cv_func___sync_fetch_and_add_4" = "yes"; then
[Define to 1 if the compiler provides the __sync_fetch_and_add function for uint32])
fi
+AC_CACHE_CHECK([for __sync_add_and_fetch_8],
+[libgo_cv_func___sync_add_and_fetch_8],
+[AC_LINK_IFELSE([
+typedef unsigned int uint64 __attribute__ ((mode (DI)));
+uint64 i;
+int main() { return __sync_add_and_fetch (&i, 1); }
+],
+[libgo_cv_func___sync_add_and_fetch_8=yes],
+[libgo_cv_func___sync_add_and_fetch_8=no])])
+if test "$libgo_cv_func___sync_add_and_fetch_8" = "yes"; then
+ AC_DEFINE(HAVE_SYNC_ADD_AND_FETCH_8, 1,
+ [Define to 1 if the compiler provides the __sync_add_and_fetch function for uint64])
+fi
+
dnl For x86 we want to use the -minline-all-stringops option to avoid
dnl forcing a stack split when calling memcpy and friends.
AC_CACHE_CHECK([whether compiler supports -minline-all-stringops],