[FFmpeg-cvslog] lavu: use intrinsics for emms on systems lacking inline asm support

Ronald S. Bultje git at videolan.org
Tue Jul 10 21:35:43 CEST 2012


ffmpeg | branch: master | Ronald S. Bultje <rsbultje at gmail.com> | Mon Jul  9 02:21:25 2012 +0200| [f80ddd5bf760e685f4d912ce6e6763e6cab45910] | committer: Martin Storsjö

lavu: use intrinsics for emms on systems lacking inline asm support

Signed-off-by: Diego Biurrun <diego at biurrun.de>
Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=f80ddd5bf760e685f4d912ce6e6763e6cab45910
---

 configure            |    3 +++
 libavutil/internal.h |    7 +++++--
 2 files changed, 8 insertions(+), 2 deletions(-)

diff --git a/configure b/configure
index 7507f8f..a1506c9 100755
--- a/configure
+++ b/configure
@@ -1116,6 +1116,7 @@ HAVE_LIST="
     MapViewOfFile
     memalign
     mkstemp
+    mm_empty
     mmap
     nanosleep
     netinet_sctp_h
@@ -2743,6 +2744,8 @@ elif enabled x86; then
 
     check_code ld intrin.h "__rdtsc()" && enable rdtsc
 
+    check_code ld mmintrin.h "_mm_empty()" && enable mm_empty
+
     enable local_aligned_8 local_aligned_16
 
     # check whether EBP is available on x86
diff --git a/libavutil/internal.h b/libavutil/internal.h
index 41e8a9a..e8bcca5 100644
--- a/libavutil/internal.h
+++ b/libavutil/internal.h
@@ -231,7 +231,7 @@ struct AVDictionary {
 #   define ONLY_IF_THREADS_ENABLED(x) NULL
 #endif
 
-#if HAVE_MMX
+#if HAVE_MMX && HAVE_INLINE_ASM
 /**
  * Empty mmx state.
  * this must be called between any dsp function and float/double code.
@@ -241,8 +241,11 @@ static av_always_inline void emms_c(void)
 {
     __asm__ volatile ("emms" ::: "memory");
 }
+#elif HAVE_MMX && HAVE_MM_EMPTY
+#   include <mmintrin.h>
+#   define emms_c _mm_empty
 #else /* HAVE_MMX */
-#define emms_c()
+#   define emms_c()
 #endif /* HAVE_MMX */
 
 #endif /* AVUTIL_INTERNAL_H */



More information about the ffmpeg-cvslog mailing list