|
From: <sv...@va...> - 2010-09-14 10:54:08
|
Author: bart
Date: 2010-09-14 11:53:57 +0100 (Tue, 14 Sep 2010)
New Revision: 11357
Log:
Added configure test that checks whether the assembler supports the SSE4a instruction lzcnt.
Modified:
trunk/configure.in
trunk/none/tests/amd64/Makefile.am
trunk/none/tests/x86/Makefile.am
Modified: trunk/configure.in
===================================================================
--- trunk/configure.in 2010-09-13 17:44:51 UTC (rev 11356)
+++ trunk/configure.in 2010-09-14 10:53:57 UTC (rev 11357)
@@ -1410,6 +1410,24 @@
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.
Modified: trunk/none/tests/amd64/Makefile.am
===================================================================
--- trunk/none/tests/amd64/Makefile.am 2010-09-13 17:44:51 UTC (rev 11356)
+++ trunk/none/tests/amd64/Makefile.am 2010-09-14 10:53:57 UTC (rev 11357)
@@ -60,7 +60,6 @@
bug127521-64 bug132813-amd64 bug132918 \
clc \
$(INSN_TESTS) \
- lzcnt64 \
rcl-amd64 \
redundantRexW \
smc1 \
@@ -69,6 +68,9 @@
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
Modified: trunk/none/tests/x86/Makefile.am
===================================================================
--- trunk/none/tests/x86/Makefile.am 2010-09-13 17:44:51 UTC (rev 11356)
+++ trunk/none/tests/x86/Makefile.am 2010-09-14 10:53:57 UTC (rev 11357)
@@ -84,7 +84,6 @@
jcxz \
lahf \
looper \
- lzcnt32 \
movx \
pushpopseg \
sbbmisc \
@@ -95,6 +94,9 @@
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)
|