From: Bart Van Assche Date: Fri, 3 Aug 2012 19:37:02 +0000 (+0000) Subject: none/tests/amd64/avx-1: Make it explicit that this test uses the vpclmulqdq instruction X-Git-Tag: svn/VALGRIND_3_8_0~47 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a36fc3e17866c1c37b1f1bad4281bdbf42f5eaa1;p=thirdparty%2Fvalgrind.git none/tests/amd64/avx-1: Make it explicit that this test uses the vpclmulqdq instruction git-svn-id: svn://svn.valgrind.org/valgrind/trunk@12821 --- diff --git a/configure.in b/configure.in index 90f0ee8795..2ba2b00918 100644 --- a/configure.in +++ b/configure.in @@ -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 diff --git a/none/tests/amd64/Makefile.am b/none/tests/amd64/Makefile.am index 7798bac415..a3b96861f9 100644 --- a/none/tests/amd64/Makefile.am +++ b/none/tests/amd64/Makefile.am @@ -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