From: Bart Van Assche Date: Tue, 14 Sep 2010 10:53:57 +0000 (+0000) Subject: Added configure test that checks whether the assembler supports the SSE4a instruction... X-Git-Tag: svn/VALGRIND_3_6_0~100 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=e8063b7b3f939da9b9d72510a5dd906581c43d56;p=thirdparty%2Fvalgrind.git Added configure test that checks whether the assembler supports the SSE4a instruction lzcnt. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@11357 --- diff --git a/configure.in b/configure.in index a47fede39f..424a4047d0 100644 --- a/configure.in +++ b/configure.in @@ -1410,6 +1410,24 @@ AC_MSG_RESULT([no]) AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes) +AC_MSG_CHECKING([if x86/amd64 assembler supports 'lzcnt']) + +AC_TRY_COMPILE([], [ + do { + __asm__ __volatile__("lzcnt %rax,%rax"); + } while (0) +], +[ + ac_have_as_lzcnt=yes + AC_MSG_RESULT([yes]) +], [ + ac_have_as_lzcnt=no + AC_MSG_RESULT([no]) +]) + +AM_CONDITIONAL([BUILD_LZCNT_TESTS], [test x$ac_have_as_lzcnt = xyes]) + + # Check for TLS support in the compiler and linker if test "x${cross_compiling}" = "xno"; then # Native compilation: check whether running a program using TLS succeeds. diff --git a/none/tests/amd64/Makefile.am b/none/tests/amd64/Makefile.am index 38e1ebbc35..bd1c8a7120 100644 --- a/none/tests/amd64/Makefile.am +++ b/none/tests/amd64/Makefile.am @@ -60,7 +60,6 @@ check_PROGRAMS = \ bug127521-64 bug132813-amd64 bug132918 \ clc \ $(INSN_TESTS) \ - lzcnt64 \ rcl-amd64 \ redundantRexW \ smc1 \ @@ -69,6 +68,9 @@ check_PROGRAMS = \ if BUILD_SSSE3_TESTS check_PROGRAMS += ssse3_misaligned endif +if BUILD_LZCNT_TESTS + check_PROGRAMS += lzcnt64 +endif # DDD: these need to be made to work on Darwin like the x86/ ones were. if ! VGCONF_OS_IS_DARWIN diff --git a/none/tests/x86/Makefile.am b/none/tests/x86/Makefile.am index c0f0c08ae1..0fa2194c2e 100644 --- a/none/tests/x86/Makefile.am +++ b/none/tests/x86/Makefile.am @@ -84,7 +84,6 @@ check_PROGRAMS = \ jcxz \ lahf \ looper \ - lzcnt32 \ movx \ pushpopseg \ sbbmisc \ @@ -95,6 +94,9 @@ check_PROGRAMS = \ if BUILD_SSSE3_TESTS check_PROGRAMS += ssse3_misaligned endif +if BUILD_LZCNT_TESTS + check_PROGRAMS += lzcnt32 +endif AM_CFLAGS += @FLAG_M32@ $(FLAG_MMMX) $(FLAG_MSSE)