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>
This commit is contained in:
James Almer 2016-02-04 01:49:01 -03:00
parent 37db3e8931
commit b3b0ecee15
1 changed files with 6 additions and 0 deletions

View File

@ -34,7 +34,13 @@ void avpriv_emms_yasm(void);
*/ */
static av_always_inline void emms_c(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) if(av_get_cpu_flags() & AV_CPU_FLAG_MMX)
#endif
__asm__ volatile ("emms" ::: "memory"); __asm__ volatile ("emms" ::: "memory");
} }
#elif HAVE_MMX && HAVE_MM_EMPTY #elif HAVE_MMX && HAVE_MM_EMPTY