From f84adcc43f07cf61be79d9c56dfbf2dad15c2810 Mon Sep 17 00:00:00 2001 From: Julian Seward Date: Sat, 9 Feb 2008 12:07:40 +0000 Subject: [PATCH] Only build the SSSE3 tests on machines whose assemblers know about these instructions. git-svn-id: svn://svn.valgrind.org/valgrind/trunk@7387 --- configure.in | 22 ++++++++++++++++++++++ none/tests/amd64/Makefile.am | 5 ++++- none/tests/x86/Makefile.am | 7 +++++-- 3 files changed, 31 insertions(+), 3 deletions(-) diff --git a/configure.in b/configure.in index ba3944b576..dff6a7b2e6 100644 --- a/configure.in +++ b/configure.in @@ -832,6 +832,28 @@ AC_MSG_RESULT([no]) AM_CONDITIONAL(BUILD_SSE3_TESTS, test x$ac_have_as_sse3 = xyes) +# Ditto for SSSE3 instructions (note extra S) +# Note, this doesn't generate a C-level symbol. It generates a +# automake-level symbol (BUILD_SSSE3_TESTS), used in test Makefile.am's +AC_MSG_CHECKING([if x86/amd64 assembler speaks SSSE3]) + +AC_TRY_COMPILE(, [ + do { long long int x; + __asm__ __volatile__( + "pabsb (%0),%%xmm7" : : "r"(&x) : "xmm7" ); } + while (0) +], +[ +ac_have_as_ssse3=yes +AC_MSG_RESULT([yes]) +], [ +ac_have_as_ssse3=no +AC_MSG_RESULT([no]) +]) + +AM_CONDITIONAL(BUILD_SSSE3_TESTS, test x$ac_have_as_ssse3 = xyes) + + # Check for TLS support in the compiler and linker AC_CACHE_CHECK([for TLS support], vg_cv_tls, [AC_ARG_ENABLE(tls, [ --enable-tls platform supports TLS], diff --git a/none/tests/amd64/Makefile.am b/none/tests/amd64/Makefile.am index ca92455f45..9ca0b442a7 100644 --- a/none/tests/amd64/Makefile.am +++ b/none/tests/amd64/Makefile.am @@ -7,6 +7,9 @@ INSN_TESTS = insn_basic insn_mmx insn_sse insn_sse2 insn_fpu if BUILD_SSE3_TESTS INSN_TESTS += insn_sse3 insn_ssse3 endif +if BUILD_SSSE3_TESTS + INSN_TESTS += insn_ssse3 ssse3_misaligned +endif # Explicitly include insn_sse3 even if ! BUILD_SSE3_TESTS, # to avoid packaging screwups if 'make dist' is run on a machine @@ -48,7 +51,7 @@ check_PROGRAMS = \ faultstatus fcmovnu fxtract $(INSN_TESTS) looper jrcxz \ rcl-amd64 \ redundantRexW \ - smc1 shrld ssse3_misaligned \ + smc1 shrld \ nibz_bennee_mmap \ slahf-amd64 diff --git a/none/tests/x86/Makefile.am b/none/tests/x86/Makefile.am index 6c08f9f621..4767b70802 100644 --- a/none/tests/x86/Makefile.am +++ b/none/tests/x86/Makefile.am @@ -5,7 +5,10 @@ CLEANFILES = $(addsuffix .c,$(INSN_TESTS)) INSN_TESTS = insn_basic insn_fpu insn_cmov insn_mmx insn_mmxext \ insn_sse insn_sse2 if BUILD_SSE3_TESTS - INSN_TESTS += insn_sse3 insn_ssse3 + INSN_TESTS += insn_sse3 +endif +if BUILD_SSSE3_TESTS + INSN_TESTS += insn_ssse3 ssse3_misaligned endif # Explicitly include insn_sse3 even if ! BUILD_SSE3_TESTS, @@ -61,7 +64,7 @@ check_PROGRAMS = \ getseg incdec_alt $(INSN_TESTS) \ jcxz \ lahf looper movx int pushpopseg sbbmisc \ - seg_override sigcontext smc1 ssse3_misaligned yield + seg_override sigcontext smc1 yield AM_CFLAGS = $(WERROR) -Winline -Wall -Wshadow \ @FLAG_M32@ -g -I$(top_srcdir)/include \ -- 2.47.3