]> git.ipfire.org Git - thirdparty/valgrind.git/commitdiff
none/tests/amd64/avx-1: Make it explicit that this test uses the vpclmulqdq instruction
authorBart Van Assche <bvanassche@acm.org>
Fri, 3 Aug 2012 19:37:02 +0000 (19:37 +0000)
committerBart Van Assche <bvanassche@acm.org>
Fri, 3 Aug 2012 19:37:02 +0000 (19:37 +0000)
git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12821

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

index 90f0ee87958c2f3cd0e236ff4601dd35bbff1718..2ba2b009182fbd9d7f457097c8fb8aeac6fd74af 100644 (file)
@@ -1694,6 +1694,31 @@ AC_MSG_RESULT([no])
 AM_CONDITIONAL(BUILD_PCLMULQDQ_TESTS, test x$ac_have_as_pclmulqdq = xyes)
 
 
+# does the x86/amd64 assembler understand the VPCLMULQDQ instruction?
+# Note, this doesn't generate a C-level symbol.  It generates a
+# automake-level symbol (BUILD_VPCLMULQDQ_TESTS), used in test Makefile.am's
+AC_MSG_CHECKING([if x86/amd64 assembler supports 'vpclmulqdq'])
+AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[]], [[
+  do {
+      /*
+       * Carry-less multiplication of xmm1 with xmm2 and store the result in
+       * xmm3. The immediate is used to determine which quadwords of xmm1 and
+       * xmm2 should be used.
+       */
+   __asm__ __volatile__(
+      "vpclmulqdq \$0,%%xmm1,%%xmm2,%%xmm3" : : : );
+  } while (0)
+]])], [
+ac_have_as_vpclmulqdq=yes
+AC_MSG_RESULT([yes])
+], [
+ac_have_as_vpclmulqdq=no
+AC_MSG_RESULT([no])
+])
+
+AM_CONDITIONAL(BUILD_VPCLMULQDQ_TESTS, test x$ac_have_as_vpclmulqdq = xyes)
+
+
 # does the x86/amd64 assembler understand the LZCNT instruction?
 # Note, this doesn't generate a C-level symbol.  It generates a
 # automake-level symbol (BUILD_LZCNT_TESTS), used in test Makefile.am's
index 7798bac4153de8919c07c7b49ad9a26b0b8018b5..a3b96861f9c03856811f8c45d0281e44fca8644a 100644 (file)
@@ -105,7 +105,7 @@ if BUILD_SSE42_TESTS
        pcmpstr64w pcmpxstrx64w
 endif
 if BUILD_AVX_TESTS
-if BUILD_PCLMULQDQ_TESTS
+if BUILD_VPCLMULQDQ_TESTS
  check_PROGRAMS += avx-1
 endif
 endif