From: "Ronald S. Bultje" <[email protected]>
---
configure | 3 +++
libavutil/internal.h | 7 +++++--
2 files changed, 8 insertions(+), 2 deletions(-)
diff --git a/configure b/configure
index 4c1cdc3..3d02e75 100755
--- a/configure
+++ b/configure
@@ -1117,6 +1117,7 @@ HAVE_LIST="
MapViewOfFile
memalign
mkstemp
+ mm_empty
mmap
nanosleep
netinet_sctp_h
@@ -2643,6 +2644,8 @@ check_cc <<EOF && enable inline_asm
void foo(void) { __asm__ volatile ("" ::); }
EOF
+check_code cc mmintrin.h "_mm_empty()" && enable mm_empty
+
_restrict=
for restrict_keyword in restrict __restrict__ __restrict; do
check_cc <<EOF && _restrict=$restrict_keyword && break
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 */
--
1.7.9.5
_______________________________________________
libav-devel mailing list
[email protected]
https://lists.libav.org/mailman/listinfo/libav-devel