From: Philippe Waroquiers Date: Sat, 20 May 2017 14:59:54 +0000 (+0000) Subject: Compile fb_test_amd64 only if adx instructions can be compiled X-Git-Tag: svn/VALGRIND_3_13_0~33 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f2ede90cbbb4ac89920a270483b3118d13056de5;p=thirdparty%2Fvalgrind.git Compile fb_test_amd64 only if adx instructions can be compiled Note: this just unbreaks the build on avx + non_adx capable systems (such as gcc farm gcc20). adx capable system should probably be better handled: * ./tests/x86_amd64_features cannot check for adx flag (so fb_test_amd64 is run if compiled and system is avx capable, which might give problems if gcc/as can compile the test, but the cpu cannot execute adx instructions) * on an adx capable system, a native run of cpuid tells it is adx capable but under valgrind, cpuid reports the valgrind synthetic cpu is not adx capable. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@16401 --- diff --git a/configure.ac b/configure.ac index d134aee0dd..b95a041c67 100644 --- a/configure.ac +++ b/configure.ac @@ -2661,6 +2661,26 @@ AC_MSG_RESULT([no]) AM_CONDITIONAL(BUILD_MPX_TESTS, test x$ac_have_as_mpx = xyes) +# does the amd64 assembler understand ADX instructions? +# Note, this doesn't generate a C-level symbol. It generates a +# automake-level symbol (BUILD_ADX_TESTS), used in test Makefile.am's +AC_MSG_CHECKING([if amd64 assembler knows the ADX instructions]) + +AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[ + do { + asm ("adcxq %r14,%r8"); + } while (0) +]])], [ +ac_have_as_adx=yes +AC_MSG_RESULT([yes]) +], [ +ac_have_as_adx=no +AC_MSG_RESULT([no]) +]) + +AM_CONDITIONAL(BUILD_ADX_TESTS, test x$ac_have_as_adx = xyes) + + # Does the C compiler support the "ifunc" attribute # Note, this doesn't generate a C-level symbol. It generates a # automake-level symbol (BUILD_IFUNC_TESTS), used in test Makefile.am's diff --git a/none/tests/amd64/Makefile.am b/none/tests/amd64/Makefile.am index cca385e43e..a2b83ebc62 100644 --- a/none/tests/amd64/Makefile.am +++ b/none/tests/amd64/Makefile.am @@ -111,8 +111,10 @@ check_PROGRAMS = \ if BUILD_ADDR32_TESTS check_PROGRAMS += asorep endif -if BUILD_AVX_TESTS +if BUILD_ADX_TESTS check_PROGRAMS += fb_test_amd64 +endif +if BUILD_AVX_TESTS if BUILD_VPCLMULQDQ_TESTS check_PROGRAMS += avx-1 endif