lavu: use intrinsics for emms on systems lacking inline asm support

Signed-off-by: Diego Biurrun <diego@biurrun.de>
Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
Ronald S. Bultje 2012-07-09 02:21:25 +02:00 committed by Martin Storsjö
parent 620b1e7e98
commit f80ddd5bf7
2 changed files with 8 additions and 2 deletions

3
configure vendored
View File

@ -1116,6 +1116,7 @@ HAVE_LIST="
MapViewOfFile MapViewOfFile
memalign memalign
mkstemp mkstemp
mm_empty
mmap mmap
nanosleep nanosleep
netinet_sctp_h netinet_sctp_h
@ -2743,6 +2744,8 @@ elif enabled x86; then
check_code ld intrin.h "__rdtsc()" && enable rdtsc check_code ld intrin.h "__rdtsc()" && enable rdtsc
check_code ld mmintrin.h "_mm_empty()" && enable mm_empty
enable local_aligned_8 local_aligned_16 enable local_aligned_8 local_aligned_16
# check whether EBP is available on x86 # check whether EBP is available on x86

View File

@ -231,7 +231,7 @@ struct AVDictionary {
# define ONLY_IF_THREADS_ENABLED(x) NULL # define ONLY_IF_THREADS_ENABLED(x) NULL
#endif #endif
#if HAVE_MMX #if HAVE_MMX && HAVE_INLINE_ASM
/** /**
* Empty mmx state. * Empty mmx state.
* this must be called between any dsp function and float/double code. * 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"); __asm__ volatile ("emms" ::: "memory");
} }
#elif HAVE_MMX && HAVE_MM_EMPTY
# include <mmintrin.h>
# define emms_c _mm_empty
#else /* HAVE_MMX */ #else /* HAVE_MMX */
#define emms_c() # define emms_c()
#endif /* HAVE_MMX */ #endif /* HAVE_MMX */
#endif /* AVUTIL_INTERNAL_H */ #endif /* AVUTIL_INTERNAL_H */