[PATCH 1/3] Check SSSE3 in the build system.

Liu Xinyun xinyun.liu at intel.com
Wed Dec 8 02:38:31 PST 2010


Add --disable-ssse3 option.

Signed-off-by: Liu Xinyun <xinyun.liu at intel.com>
Signed-off-by: Xu Samuel <samuel.xu at intel.com>
Signed-off-by: Ma Ling <ling.ma at intel.com>
Signed-off-by: Zhao Yakui <yakui.zhao at intel.com>
---
 configure.ac |   46 ++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 46 insertions(+), 0 deletions(-)

diff --git a/configure.ac b/configure.ac
index 147e1bf..6b92651 100644
--- a/configure.ac
+++ b/configure.ac
@@ -372,6 +372,47 @@ fi
 AM_CONDITIONAL(USE_SSE2, test $have_sse2_intrinsics = yes)
 
 dnl ===========================================================================
+dnl Check for SSSE3
+
+if test "x$SSSE3_CFLAGS" = "x" ; then
+   SSSE3_CFLAGS="-mmmx -mssse3 -Winline"
+fi
+
+have_ssse3_assembler=no
+AC_MSG_CHECKING(whether to use SSSE3 assembler)
+xserver_save_CFLAGS=$CFLAGS
+CFLAGS="$SSSE3_CFLAGS $CFLAGS"
+
+AC_COMPILE_IFELSE([
+#if defined(__GNUC__) && (__GNUC__ < 4 || (__GNUC__ == 4 && __GNUC_MINOR__ < 3))
+#      error "Need GCC >= 4.3 for SSSE3 assembler on x86"
+#endif
+int main () {
+    __asm__ __volatile__("PSHUFB %xmm1, %xmm0;");
+    return 0;
+}], have_ssse3_assembler=yes)
+CFLAGS=$xserver_save_CFLAGS
+
+AC_ARG_ENABLE(ssse3,
+   [AC_HELP_STRING([--disable-ssse3],
+                   [disable SSSE3 fast paths])],
+   [enable_ssse3=$enableval], [enable_ssse3=auto])
+
+if test $enable_ssse3 = no || test $SUNCC = yes ; then
+   have_ssse3_assembler=disabled
+fi
+
+if test $have_ssse3_assembler = yes ; then
+   AC_DEFINE(USE_SSSE3, 1, [use SSSE3 compiler assembler])
+fi
+
+AC_MSG_RESULT($have_ssse3_assembler)
+if test $enable_ssse3 = yes && test $have_assembler = no ; then
+   AC_MSG_ERROR([SSSE3 assembler not detected])
+fi
+
+AM_CONDITIONAL(USE_SSSE3, test $have_ssse3_assembler = yes)
+dnl ===========================================================================
 dnl Other special flags needed when building code using MMX or SSE instructions
 case $host_os in
    solaris*)
@@ -397,6 +438,9 @@ case $host_os in
       if test "x$SSE2_LDFLAGS" = "x" ; then
 	 SSE2_LDFLAGS="$HWCAP_LDFLAGS"
       fi
+      if test "x$SSSE3_LDFLAGS" = "x" ; then
+	 SSSE3_LDFLAGS="$HWCAP_LDFLAGS"
+      fi
       ;;
 esac
 
@@ -404,6 +448,8 @@ AC_SUBST(MMX_CFLAGS)
 AC_SUBST(MMX_LDFLAGS)
 AC_SUBST(SSE2_CFLAGS)
 AC_SUBST(SSE2_LDFLAGS)
+AC_SUBST(SSSE3_CFLAGS)
+AC_SUBST(SSSE3_LDFLAGS)
 
 dnl ===========================================================================
 dnl Check for VMX/Altivec
-- 
1.7.0.4


--d6Gm4EdcadzBjdND
Content-Type: text/x-diff; charset=us-ascii
Content-Disposition: attachment; filename="0002-Improve-CPU-feature-detection.patch"



More information about the Pixman mailing list