[vlc-commits] Revert "Remove unused 3dnow and mmxext checks"

Rémi Denis-Courmont git at videolan.org
Sun Aug 5 11:46:55 CEST 2012


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sun Aug  5 12:38:51 2012 +0300| [125ec24e0d35ebddd4d36f4083af80896f69636a] | committer: Rémi Denis-Courmont

Revert "Remove unused 3dnow and mmxext checks"

This reverts commit 6fe7eb6048e6b3f473006855f4e4905fa54ba910.
These checks are still in use outside of memcpy() optimizations.
Note this revert breaks the build on some platforms due to code rot.

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=125ec24e0d35ebddd4d36f4083af80896f69636a
---

 configure.ac |   41 +++++++++++++++++++++++++++++++++++++++++
 1 file changed, 41 insertions(+)

diff --git a/configure.ac b/configure.ac
index d951751..f0865f4 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1095,6 +1095,7 @@ AC_ARG_ENABLE(mmx,
   esac
 ])
 have_mmx="no"
+have_mmxext="no"
 AS_IF([test "${enable_mmx}" != "no"], [
   ARCH="${ARCH} mmx"
   VLC_SAVE_FLAGS
@@ -1141,9 +1142,26 @@ asm volatile("packuswb %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
     have_mmx="yes"
   ])
 
+  AC_CACHE_CHECK([if $CC groks MMX EXT inline assembly],
+                 [ac_cv_mmxext_inline], [
+    AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
+void *p;
+asm volatile("maskmovq %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
+]])
+    ], [
+      ac_cv_mmxext_inline=yes
+    ], [
+      ac_cv_mmxext_inline=no
+    ])
+  ])
   VLC_RESTORE_FLAGS
+  AS_IF([test "${ac_cv_mmxext_inline}" != "no"], [
+    AC_DEFINE(CAN_COMPILE_MMXEXT, 1, [Define to 1 if MMX EXT inline assembly is available.])
+    have_mmxext="yes"
+  ])
 ])
 AM_CONDITIONAL([HAVE_MMX], [test "${have_mmx}" = "yes"])
+AM_CONDITIONAL([HAVE_MMXEXT], [test "${have_mmxext}" = "yes"])
 
 dnl  Check for fully workin SSE2 intrinsics
 dnl  We need support for -mmmx, we need <emmintrin.h>, and we also need a
@@ -1307,6 +1325,29 @@ asm volatile("insertq %%xmm1,%%xmm0"::"r"(p):"xmm0", "xmm1");
 ])
 AM_CONDITIONAL([HAVE_SSE2], [test "$have_sse2" = "yes"])
 
+VLC_SAVE_FLAGS
+CFLAGS="${CFLAGS} -mmmx"
+have_3dnow="no"
+AC_CACHE_CHECK([if $CC groks 3D Now! inline assembly], [ac_cv_3dnow_inline], [
+  AC_COMPILE_IFELSE([AC_LANG_PROGRAM(,[[
+void *p;
+asm volatile("pfadd %%mm1,%%mm2"::"r"(p):"mm1", "mm2");
+]])
+  ], [
+    ac_cv_3dnow_inline=yes
+  ], [
+    ac_cv_3dnow_inline=no
+  ])
+])
+VLC_RESTORE_FLAGS
+AS_IF([test "${ac_cv_3dnow_inline}" != "no"], [
+  AC_DEFINE(CAN_COMPILE_3DNOW, 1,
+            [Define to 1 if 3D Now! inline assembly is available.])
+  have_3dnow="yes"
+])
+AM_CONDITIONAL([HAVE_3DNOW], [test "$have_3dnow" = "yes"])
+
+
 AC_ARG_ENABLE(neon,
   [AS_HELP_STRING([--disable-neon],
     [disable NEON optimizations (default auto)])],, [



More information about the vlc-commits mailing list