swscale: Execute sfence and emms depending on runtime flags.
Originally committed as revision 29127 to svn://svn.mplayerhq.hu/mplayer/trunk/libswscale
This commit is contained in:
parent
3dd2f87e61
commit
5b7c7dd329
@ -26,15 +26,6 @@
|
|||||||
#undef PAVGB
|
#undef PAVGB
|
||||||
#undef PREFETCH
|
#undef PREFETCH
|
||||||
#undef PREFETCHW
|
#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
|
#if HAVE_AMD3DNOW
|
||||||
#define PREFETCH "prefetch"
|
#define PREFETCH "prefetch"
|
||||||
@ -47,12 +38,6 @@
|
|||||||
#define PREFETCHW " # nop"
|
#define PREFETCHW " # nop"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if HAVE_MMX2
|
|
||||||
#define SFENCE "sfence"
|
|
||||||
#else
|
|
||||||
#define SFENCE " # nop"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if HAVE_MMX2
|
#if HAVE_MMX2
|
||||||
#define PAVGB(a,b) "pavgb " #a ", " #b " \n\t"
|
#define PAVGB(a,b) "pavgb " #a ", " #b " \n\t"
|
||||||
#elif HAVE_AMD3DNOW
|
#elif HAVE_AMD3DNOW
|
||||||
@ -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);
|
fillPlane(dst[3], dstStride[3], dstW, dstY-lastDstY, lastDstY, 255);
|
||||||
|
|
||||||
#if HAVE_MMX
|
#if HAVE_MMX
|
||||||
__asm__ volatile(SFENCE:::"memory");
|
if (flags & SWS_CPU_CAPS_MMX2 ) __asm__ volatile("sfence":::"memory");
|
||||||
__asm__ volatile(EMMS:::"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
|
#endif
|
||||||
/* store changed local vars back in the context */
|
/* store changed local vars back in the context */
|
||||||
c->dstY= dstY;
|
c->dstY= dstY;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user