[FFmpeg-cvslog] x86/emms: empty the mmx state unconditionally on supported targets

James Almer git at videolan.org
Thu Feb 4 05:50:33 CET 2016


ffmpeg | branch: master | James Almer <jamrial at gmail.com> | Thu Feb  4 01:49:01 2016 -0300| [b3b0ecee1550eb3cba0f4c198948f674f675780c] | committer: James Almer

x86/emms: empty the mmx state unconditionally on supported targets

Reviewed-by: Michael Niedermayer <michael at niedermayer.cc>
Signed-off-by: James Almer <jamrial at gmail.com>

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

 libavutil/x86/emms.h |    6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/libavutil/x86/emms.h b/libavutil/x86/emms.h
index a529b6b..6fda6e2 100644
--- a/libavutil/x86/emms.h
+++ b/libavutil/x86/emms.h
@@ -34,7 +34,13 @@ void avpriv_emms_yasm(void);
  */
 static av_always_inline void emms_c(void)
 {
+/* Some inlined functions may also use mmx instructions regardless of
+ * runtime cpuflags. With that in mind, we unconditionally empty the
+ * mmx state if the target cpu chosen at configure time supports it.
+ */
+#if !defined(__MMX__)
     if(av_get_cpu_flags() & AV_CPU_FLAG_MMX)
+#endif
         __asm__ volatile ("emms" ::: "memory");
 }
 #elif HAVE_MMX && HAVE_MM_EMPTY



More information about the ffmpeg-cvslog mailing list