]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
Compile fb_test_amd64 only if adx instructions can be compiled
authorPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 20 May 2017 14:59:54 +0000 (14:59 +0000)
committerPhilippe Waroquiers <philippe.waroquiers@skynet.be>
Sat, 20 May 2017 14:59:54 +0000 (14:59 +0000)
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

configure.ac
none/tests/amd64/Makefile.am

index d134aee0dd0144afe2e02144a4ad03617da48584..b95a041c67caea52979c2dec985de09f8800de74 100644 (file)
@@ -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
index cca385e43eb4e875633cc8b9182681ec8d0d9e07..a2b83ebc621762dfdd01aa427ab84466e32f1bbf 100644 (file)
@@ -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