summaryrefslogtreecommitdiffstats
path: root/libswscale/swscale_template.c
diff options
context:
space:
mode:
authorramiro <ramiro@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-04-02 18:31:22 +0000
committerramiro <ramiro@b3059339-0415-0410-9bf9-f77b7e298cf2>2009-04-02 18:31:22 +0000
commit755c96e95306fc0f48a6da4c13486db8f593fcdf (patch)
treeb457309e75eb1657a130fde34ffd69e2b979ab32 /libswscale/swscale_template.c
parent2e903f7c752dceb15988ac04f81a5de12a7a0a13 (diff)
downloadmpv-755c96e95306fc0f48a6da4c13486db8f593fcdf.tar.bz2
mpv-755c96e95306fc0f48a6da4c13486db8f593fcdf.tar.xz
swscale: Execute sfence and emms depending on runtime flags.
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@29127 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libswscale/swscale_template.c')
-rw-r--r--libswscale/swscale_template.c21
1 files changed, 4 insertions, 17 deletions
diff --git a/libswscale/swscale_template.c b/libswscale/swscale_template.c
index ecf5c10131..04e9d17a64 100644
--- a/libswscale/swscale_template.c
+++ b/libswscale/swscale_template.c
@@ -26,15 +26,6 @@
#undef PAVGB
#undef PREFETCH
#undef PREFETCHW
-#undef EMMS
-#undef SFENCE
-
-#if HAVE_AMD3DNOW
-/* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */
-#define EMMS "femms"
-#else
-#define EMMS "emms"
-#endif
#if HAVE_AMD3DNOW
#define PREFETCH "prefetch"
@@ -48,12 +39,6 @@
#endif
#if HAVE_MMX2
-#define SFENCE "sfence"
-#else
-#define SFENCE " # nop"
-#endif
-
-#if HAVE_MMX2
#define PAVGB(a,b) "pavgb " #a ", " #b " \n\t"
#elif HAVE_AMD3DNOW
#define PAVGB(a,b) "pavgusb " #a ", " #b " \n\t"
@@ -3209,8 +3194,10 @@ static int RENAME(swScale)(SwsContext *c, uint8_t* src[], int srcStride[], int s
fillPlane(dst[3], dstStride[3], dstW, dstY-lastDstY, lastDstY, 255);
#if HAVE_MMX
- __asm__ volatile(SFENCE:::"memory");
- __asm__ volatile(EMMS:::"memory");
+ if (flags & SWS_CPU_CAPS_MMX2 ) __asm__ volatile("sfence":::"memory");
+ /* On K6 femms is faster than emms. On K7 femms is directly mapped to emms. */
+ if (flags & SWS_CPU_CAPS_3DNOW) __asm__ volatile("femms" :::"memory");
+ else __asm__ volatile("emms" :::"memory");
#endif
/* store changed local vars back in the context */
c->dstY= dstY;