Check whether binutils supports TSX instructions.
Guard none/tests/amd64/tm1 accordingly.
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13587 a5019735-40e9-0310-863c-91ae7b9d1cf9
diff --git a/configure.ac b/configure.ac
index 22c98be..b3570cb 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1997,6 +1997,28 @@
AM_CONDITIONAL(BUILD_AVX2_TESTS, test x$ac_have_as_avx2 = xyes)
+# does the x86/amd64 assembler understand TSX instructions?
+# Note, this doesn't generate a C-level symbol. It generates a
+# automake-level symbol (BUILD_TSX_TESTS), used in test Makefile.am's
+AC_MSG_CHECKING([if x86/amd64 assembler speaks TSX])
+
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+ do {
+ __asm__ __volatile__(
+ " xbegin Lfoo \n\t"
+ "Lfoo: xend \n\t");
+ } while (0)
+]])], [
+ac_have_as_tsx=yes
+AC_MSG_RESULT([yes])
+], [
+ac_have_as_tsx=no
+AC_MSG_RESULT([no])
+])
+
+AM_CONDITIONAL(BUILD_TSX_TESTS, test x$ac_have_as_tsx = xyes)
+
+
# does the x86/amd64 assembler understand BMI1 and BMI2 instructions?
# Note, this doesn't generate a C-level symbol. It generates a
# automake-level symbol (BUILD_BMI_TESTS), used in test Makefile.am's
diff --git a/none/tests/amd64/Makefile.am b/none/tests/amd64/Makefile.am
index 6e00b2c..cc351b7 100644
--- a/none/tests/amd64/Makefile.am
+++ b/none/tests/amd64/Makefile.am
@@ -114,7 +114,10 @@
endif
endif
if BUILD_AVX2_TESTS
- check_PROGRAMS += avx2-1 tm1
+ check_PROGRAMS += avx2-1
+endif
+if BUILD_TSX_TESTS
+ check_PROGRAMS += tm1
endif
if BUILD_BMI_TESTS
check_PROGRAMS += bmi