From: Florian Krohm Date: Mon, 30 Sep 2013 16:32:53 +0000 (+0000) Subject: Check whether binutils supports TSX instructions. X-Git-Tag: svn/VALGRIND_3_9_0~104 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=392c321bb4ba6f5a36d684d796eee647c3d2a606;p=thirdparty%2Fvalgrind.git Check whether binutils supports TSX instructions. Guard none/tests/amd64/tm1 accordingly. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@13587 --- diff --git a/configure.ac b/configure.ac index 22c98be1fc..b3570cb44d 100644 --- a/configure.ac +++ b/configure.ac @@ -1997,6 +1997,28 @@ AC_MSG_RESULT([no]) 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 6e00b2cd88..cc351b7b06 100644 --- a/none/tests/amd64/Makefile.am +++ b/none/tests/amd64/Makefile.am @@ -114,7 +114,10 @@ if BUILD_VPCLMULQDQ_TESTS 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