aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorOla Liljedahl <ola.liljedahl@linaro.org>2016-05-17 21:21:16 +0200
committerMaxim Uvarov <maxim.uvarov@linaro.org>2016-05-18 14:50:08 +0300
commit6c89f9074f9b75dfcf0f3759a300773afe7768c4 (patch)
treee815bb0ff0a81afc87806bf51197627ee0b3c0cb /configure.ac
parent3668168090faa3bdcc70a23e9f480e04a6a24609 (diff)
linux-generic: odp_atomic_internal.h: add 128-bit atomics
Add detection of availability of the -mcx16 compiler flag to the configure script. This flag is necessary on x86-64 to enable cpmxchg16. Implement 128-bit atomics if natively supported by the platform. 128-bit atomics are used by linux-generic timer implementation on certain targets (e.g. x86-64) for lock-free implementation. Signed-off-by: Ola Liljedahl <ola.liljedahl@linaro.org> Reviewed-and-tested-by: Bill Fischofer <bill.fischofer@linaro.org> Signed-off-by: Maxim Uvarov <maxim.uvarov@linaro.org>
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac13
1 files changed, 13 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac
index c59d2d1be..7cd6670c9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -207,6 +207,19 @@ ODP_CFLAGS="$ODP_CFLAGS -std=c99"
# Extra flags for example to suppress certain warning types
ODP_CFLAGS="$ODP_CFLAGS $ODP_CFLAGS_EXTRA"
+#########################################################################
+# Check if compiler supports cmpxchng16
+##########################################################################
+my_save_cflags="$CFLAGS"
+CFLAGS=-mcx16
+AC_MSG_CHECKING([whether CC supports -mcx16])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([])],
+ [AC_MSG_RESULT([yes])]
+ [ODP_CFLAGS="$ODP_CFLAGS -mcx16"],
+ [AC_MSG_RESULT([no])]
+)
+CFLAGS="$my_save_cflags"
+
##########################################################################
# Default include setup
##########################################################################