Commit 2d28dd55 authored by michael's avatar michael

3dnow prefetch & sfence


git-svn-id: file:///var/local/repositories/mplayer/trunk/postproc@2521 b3059339-0415-0410-9bf9-f77b7e298cf2
parent f04f18ad
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <string.h> #include <string.h>
#include "../config.h" #include "../config.h"
#include "swscale.h" #include "swscale.h"
#include "../mmx_defs.h"
//#undef HAVE_MMX2 //#undef HAVE_MMX2
//#undef HAVE_MMX //#undef HAVE_MMX
...@@ -929,20 +930,15 @@ static inline void hyscale(uint16_t *dst, int dstWidth, uint8_t *src, int srcWid ...@@ -929,20 +930,15 @@ static inline void hyscale(uint16_t *dst, int dstWidth, uint8_t *src, int srcWid
"xorl %%ecx, %%ecx \n\t" "xorl %%ecx, %%ecx \n\t"
"xorl %%ebx, %%ebx \n\t" "xorl %%ebx, %%ebx \n\t"
"movw %4, %%bx \n\t" // (xInc*4)&0xFFFF "movw %4, %%bx \n\t" // (xInc*4)&0xFFFF
#ifdef HAVE_MMX2
#define FUNNY_Y_CODE \
"prefetchnta 1024(%%esi) \n\t"\
"prefetchnta 1056(%%esi) \n\t"\
"prefetchnta 1088(%%esi) \n\t"\
"call funnyYCode \n\t"\
"movq temp0, %%mm2 \n\t"\
"xorl %%ecx, %%ecx \n\t"
#else
#define FUNNY_Y_CODE \ #define FUNNY_Y_CODE \
PREFETCH" 1024(%%esi) \n\t"\
PREFETCH" 1056(%%esi) \n\t"\
PREFETCH" 1088(%%esi) \n\t"\
"call funnyYCode \n\t"\ "call funnyYCode \n\t"\
"movq temp0, %%mm2 \n\t"\ "movq temp0, %%mm2 \n\t"\
"xorl %%ecx, %%ecx \n\t" "xorl %%ecx, %%ecx \n\t"
#endif
FUNNY_Y_CODE FUNNY_Y_CODE
FUNNY_Y_CODE FUNNY_Y_CODE
FUNNY_Y_CODE FUNNY_Y_CODE
...@@ -1046,20 +1042,13 @@ inline static void hcscale(uint16_t *dst, int dstWidth, ...@@ -1046,20 +1042,13 @@ inline static void hcscale(uint16_t *dst, int dstWidth,
"xorl %%ebx, %%ebx \n\t" "xorl %%ebx, %%ebx \n\t"
"movw %4, %%bx \n\t" // (xInc*4)&0xFFFF "movw %4, %%bx \n\t" // (xInc*4)&0xFFFF
#ifdef HAVE_MMX2
#define FUNNYUVCODE \ #define FUNNYUVCODE \
"prefetchnta 1024(%%esi) \n\t"\ PREFETCH" 1024(%%esi) \n\t"\
"prefetchnta 1056(%%esi) \n\t"\ PREFETCH" 1056(%%esi) \n\t"\
"prefetchnta 1088(%%esi) \n\t"\ PREFETCH" 1088(%%esi) \n\t"\
"call funnyUVCode \n\t"\ "call funnyUVCode \n\t"\
"movq temp0, %%mm2 \n\t"\ "movq temp0, %%mm2 \n\t"\
"xorl %%ecx, %%ecx \n\t" "xorl %%ecx, %%ecx \n\t"
#else
#define FUNNYUVCODE \
"call funnyUVCode \n\t"\
"movq temp0, %%mm2 \n\t"\
"xorl %%ecx, %%ecx \n\t"
#endif
FUNNYUVCODE FUNNYUVCODE
FUNNYUVCODE FUNNYUVCODE
...@@ -1439,12 +1428,8 @@ else s_xinc2= s_xinc; ...@@ -1439,12 +1428,8 @@ else s_xinc2= s_xinc;
g16Dither2= g16Dither; g16Dither2= g16Dither;
#endif #endif
} }
__asm __volatile(SFENCE:::"memory");
#ifdef HAVE_3DNOW __asm __volatile(EMMS:::"memory");
asm volatile("femms");
#elif defined (HAVE_MMX)
asm volatile("emms");
#endif
} }
......
...@@ -9,6 +9,7 @@ ...@@ -9,6 +9,7 @@
#include <string.h> #include <string.h>
#include "../config.h" #include "../config.h"
#include "swscale.h" #include "swscale.h"
#include "../mmx_defs.h"
//#undef HAVE_MMX2 //#undef HAVE_MMX2
//#undef HAVE_MMX //#undef HAVE_MMX
...@@ -929,20 +930,15 @@ static inline void hyscale(uint16_t *dst, int dstWidth, uint8_t *src, int srcWid ...@@ -929,20 +930,15 @@ static inline void hyscale(uint16_t *dst, int dstWidth, uint8_t *src, int srcWid
"xorl %%ecx, %%ecx \n\t" "xorl %%ecx, %%ecx \n\t"
"xorl %%ebx, %%ebx \n\t" "xorl %%ebx, %%ebx \n\t"
"movw %4, %%bx \n\t" // (xInc*4)&0xFFFF "movw %4, %%bx \n\t" // (xInc*4)&0xFFFF
#ifdef HAVE_MMX2
#define FUNNY_Y_CODE \
"prefetchnta 1024(%%esi) \n\t"\
"prefetchnta 1056(%%esi) \n\t"\
"prefetchnta 1088(%%esi) \n\t"\
"call funnyYCode \n\t"\
"movq temp0, %%mm2 \n\t"\
"xorl %%ecx, %%ecx \n\t"
#else
#define FUNNY_Y_CODE \ #define FUNNY_Y_CODE \
PREFETCH" 1024(%%esi) \n\t"\
PREFETCH" 1056(%%esi) \n\t"\
PREFETCH" 1088(%%esi) \n\t"\
"call funnyYCode \n\t"\ "call funnyYCode \n\t"\
"movq temp0, %%mm2 \n\t"\ "movq temp0, %%mm2 \n\t"\
"xorl %%ecx, %%ecx \n\t" "xorl %%ecx, %%ecx \n\t"
#endif
FUNNY_Y_CODE FUNNY_Y_CODE
FUNNY_Y_CODE FUNNY_Y_CODE
FUNNY_Y_CODE FUNNY_Y_CODE
...@@ -1046,20 +1042,13 @@ inline static void hcscale(uint16_t *dst, int dstWidth, ...@@ -1046,20 +1042,13 @@ inline static void hcscale(uint16_t *dst, int dstWidth,
"xorl %%ebx, %%ebx \n\t" "xorl %%ebx, %%ebx \n\t"
"movw %4, %%bx \n\t" // (xInc*4)&0xFFFF "movw %4, %%bx \n\t" // (xInc*4)&0xFFFF
#ifdef HAVE_MMX2
#define FUNNYUVCODE \ #define FUNNYUVCODE \
"prefetchnta 1024(%%esi) \n\t"\ PREFETCH" 1024(%%esi) \n\t"\
"prefetchnta 1056(%%esi) \n\t"\ PREFETCH" 1056(%%esi) \n\t"\
"prefetchnta 1088(%%esi) \n\t"\ PREFETCH" 1088(%%esi) \n\t"\
"call funnyUVCode \n\t"\ "call funnyUVCode \n\t"\
"movq temp0, %%mm2 \n\t"\ "movq temp0, %%mm2 \n\t"\
"xorl %%ecx, %%ecx \n\t" "xorl %%ecx, %%ecx \n\t"
#else
#define FUNNYUVCODE \
"call funnyUVCode \n\t"\
"movq temp0, %%mm2 \n\t"\
"xorl %%ecx, %%ecx \n\t"
#endif
FUNNYUVCODE FUNNYUVCODE
FUNNYUVCODE FUNNYUVCODE
...@@ -1439,12 +1428,8 @@ else s_xinc2= s_xinc; ...@@ -1439,12 +1428,8 @@ else s_xinc2= s_xinc;
g16Dither2= g16Dither; g16Dither2= g16Dither;
#endif #endif
} }
__asm __volatile(SFENCE:::"memory");
#ifdef HAVE_3DNOW __asm __volatile(EMMS:::"memory");
asm volatile("femms");
#elif defined (HAVE_MMX)
asm volatile("emms");
#endif
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment