summaryrefslogtreecommitdiff
path: root/libavutil/x86
diff options
context:
space:
mode:
authorJames Almer <jamrial@gmail.com>2016-02-04 01:49:01 -0300
committerJames Almer <jamrial@gmail.com>2016-02-04 01:49:01 -0300
commitb3b0ecee1550eb3cba0f4c198948f674f675780c (patch)
tree38ccff0849bf4f2a0703a600e1a0460799d8ea27 /libavutil/x86
parent37db3e8931f616abe1031770359ef30c1dcb6418 (diff)
x86/emms: empty the mmx state unconditionally on supported targets
Reviewed-by: Michael Niedermayer <michael@niedermayer.cc> Signed-off-by: James Almer <jamrial@gmail.com>
Diffstat (limited to 'libavutil/x86')
-rw-r--r--libavutil/x86/emms.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/libavutil/x86/emms.h b/libavutil/x86/emms.h
index a529b6bbbe..6fda6e2763 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