From b3b0ecee1550eb3cba0f4c198948f674f675780c Mon Sep 17 00:00:00 2001 From: James Almer Date: Thu, 4 Feb 2016 01:49:01 -0300 Subject: [PATCH] x86/emms: empty the mmx state unconditionally on supported targets Reviewed-by: Michael Niedermayer Signed-off-by: James Almer --- libavutil/x86/emms.h | 6 ++++++ 1 file changed, 6 insertions(+) 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