[Liboil-commit] 2 commits - configure.ac liboil/i386_amd64 m4/as-gcc-inline-assembly.m4

David Schleef ds at kemper.freedesktop.org
Mon Feb 25 20:30:30 PST 2008


 configure.ac                 |    6 ++++++
 liboil/i386_amd64/mas.c      |    2 ++
 m4/as-gcc-inline-assembly.m4 |   25 +++++++++++++++++++++++++
 3 files changed, 33 insertions(+)

New commits:
commit 4d72f39dcb34927413e1da5b2152640508b872fd
Author: David Schleef <ds at ginger.bigkitten.com>
Date:   Mon Feb 25 20:32:07 2008 -0800

    autoconf macro for checking gas handling asm lines

diff --git a/m4/as-gcc-inline-assembly.m4 b/m4/as-gcc-inline-assembly.m4
index 1211dde..74a231a 100644
--- a/m4/as-gcc-inline-assembly.m4
+++ b/m4/as-gcc-inline-assembly.m4
@@ -53,3 +53,28 @@ AC_DEFUN([AS_GCC_ASM_POWERPC_FPU],
   AC_MSG_RESULT([$flag_ok])
 ])
 
+AC_DEFUN([AS_GCC_INLINE_ASM_INSTRUCTION],
+[
+  AC_MSG_CHECKING([if compiler supports '$1' asm instruction])
+
+  AC_TRY_COMPILE([], [
+#ifndef __GNUC__
+#error Not GCC
+#endif
+#ifdef __GNUC_MINOR__
+#if (__GNUC__ * 1000 + __GNUC_MINOR__) < 3004
+#error GCC before 3.4 has critical bugs compiling inline assembly
+#endif
+#endif
+__asm__ ("$1"::) ], [flag_ok=yes], [flag_ok=no])
+
+  if test "X$flag_ok" = Xyes ; then
+    $2
+    true
+  else
+    $3
+    true
+  fi
+  AC_MSG_RESULT([$flag_ok])
+])
+
commit c77faaaa2fc48586902878ba33bd01286654dcb6
Author: David Schleef <ds at ginger.bigkitten.com>
Date:   Mon Feb 25 19:51:52 2008 -0800

    Add workaround for older versions of gas that don't have SSSE3 support

diff --git a/configure.ac b/configure.ac
index 5c9a0dd..352c49b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -215,6 +215,12 @@ AC_SUBST(_3DNOW_CFLAGS)
 AC_SUBST(_3DNOWEXT_CFLAGS)
 AC_SUBST(ALTIVEC_CFLAGS)
 
+dnl binutils-2.18 required for this, but is too new for FreeBSD/Solaris
+AS_GCC_INLINE_ASM_INSTRUCTION([pmaddubsw %%mm0, %%mm0], [HAVE_SSSE3_ASM=yes], [HAVE_SSSE3_ASM=no])
+if test "x$HAVE_SSSE3_ASM" = xyes ; then
+  AC_DEFINE(HAVE_SSSE3_ASM, 1, [Defined if compiler/assembler can handle SSSE3 instructions])
+fi
+
 AC_DEFINE(OIL_EXPORTS, 1, [Defined for compiling internal code])
 
 LIBOIL_CFLAGS="$LIBOIL_CFLAGS -D_BSD_SOURCE -D_GNU_SOURCE -I\$(top_srcdir) -DOIL_ENABLE_UNSTABLE_API"
diff --git a/liboil/i386_amd64/mas.c b/liboil/i386_amd64/mas.c
index 20d4d2f..8a30a78 100644
--- a/liboil/i386_amd64/mas.c
+++ b/liboil/i386_amd64/mas.c
@@ -735,6 +735,7 @@ mas8_u8_sym_mmx_5 (uint8_t *d, const uint8_t *s1_np7, const int16_t *s2_8,
 }
 OIL_DEFINE_IMPL_FULL (mas8_u8_sym_mmx_5, mas8_u8_sym_l15, OIL_IMPL_FLAG_MMX|OIL_IMPL_FLAG_MMXEXT);
 
+#ifdef HAVE_SSSE3_ASM
 void
 mas8_u8_sym_mmx_6 (uint8_t *d, const uint8_t *s1_np7, const int16_t *s2_8,
         const int16_t *s3_2, int n)
@@ -798,6 +799,7 @@ mas8_u8_sym_mmx_6 (uint8_t *d, const uint8_t *s1_np7, const int16_t *s2_8,
       : "ecx");
 }
 OIL_DEFINE_IMPL_FULL (mas8_u8_sym_mmx_6, mas8_u8_sym_l15, OIL_IMPL_FLAG_MMX|OIL_IMPL_FLAG_MMXEXT|OIL_IMPL_FLAG_SSSE3);
+#endif
 
 #ifdef ENABLE_BROKEN_IMPLS
 /* This only works for the taps array: -1, 3, -7, 21, 21, -7, 3, -1 */


More information about the Liboil-commit mailing list