|
From: <sv...@va...> - 2017-05-20 15:00:02
|
Author: philippe
Date: Sat May 20 15:59:54 2017
New Revision: 16401
Log:
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.
Modified:
trunk/configure.ac
trunk/none/tests/amd64/Makefile.am
Modified: trunk/configure.ac
==============================================================================
--- trunk/configure.ac (original)
+++ trunk/configure.ac Sat May 20 15:59:54 2017
@@ -2661,6 +2661,26 @@
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
Modified: trunk/none/tests/amd64/Makefile.am
==============================================================================
--- trunk/none/tests/amd64/Makefile.am (original)
+++ trunk/none/tests/amd64/Makefile.am Sat May 20 15:59:54 2017
@@ -111,8 +111,10 @@
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
|