Mercurial > mplayer.hg
comparison postproc/swscale.c @ 2520:b58c43aab619
3dnow prefetch & sfence
author | michael |
---|---|
date | Sun, 28 Oct 2001 19:41:50 +0000 |
parents | 6f3fa9bc3b27 |
children | b70a77066611 |
comparison
equal
deleted
inserted
replaced
2519:6f3fa9bc3b27 | 2520:b58c43aab619 |
---|---|
7 | 7 |
8 #include <inttypes.h> | 8 #include <inttypes.h> |
9 #include <string.h> | 9 #include <string.h> |
10 #include "../config.h" | 10 #include "../config.h" |
11 #include "swscale.h" | 11 #include "swscale.h" |
12 #include "../mmx_defs.h" | |
12 | 13 |
13 //#undef HAVE_MMX2 | 14 //#undef HAVE_MMX2 |
14 //#undef HAVE_MMX | 15 //#undef HAVE_MMX |
15 //#undef ARCH_X86 | 16 //#undef ARCH_X86 |
16 #define DITHER1XBPP | 17 #define DITHER1XBPP |
927 "movl %1, %%edi \n\t" // buf1 | 928 "movl %1, %%edi \n\t" // buf1 |
928 "movl %3, %%edx \n\t" // (xInc*4)>>16 | 929 "movl %3, %%edx \n\t" // (xInc*4)>>16 |
929 "xorl %%ecx, %%ecx \n\t" | 930 "xorl %%ecx, %%ecx \n\t" |
930 "xorl %%ebx, %%ebx \n\t" | 931 "xorl %%ebx, %%ebx \n\t" |
931 "movw %4, %%bx \n\t" // (xInc*4)&0xFFFF | 932 "movw %4, %%bx \n\t" // (xInc*4)&0xFFFF |
932 #ifdef HAVE_MMX2 | 933 |
933 #define FUNNY_Y_CODE \ | 934 #define FUNNY_Y_CODE \ |
934 "prefetchnta 1024(%%esi) \n\t"\ | 935 PREFETCH" 1024(%%esi) \n\t"\ |
935 "prefetchnta 1056(%%esi) \n\t"\ | 936 PREFETCH" 1056(%%esi) \n\t"\ |
936 "prefetchnta 1088(%%esi) \n\t"\ | 937 PREFETCH" 1088(%%esi) \n\t"\ |
937 "call funnyYCode \n\t"\ | 938 "call funnyYCode \n\t"\ |
938 "movq temp0, %%mm2 \n\t"\ | 939 "movq temp0, %%mm2 \n\t"\ |
939 "xorl %%ecx, %%ecx \n\t" | 940 "xorl %%ecx, %%ecx \n\t" |
940 #else | 941 |
941 #define FUNNY_Y_CODE \ | |
942 "call funnyYCode \n\t"\ | |
943 "movq temp0, %%mm2 \n\t"\ | |
944 "xorl %%ecx, %%ecx \n\t" | |
945 #endif | |
946 FUNNY_Y_CODE | 942 FUNNY_Y_CODE |
947 FUNNY_Y_CODE | 943 FUNNY_Y_CODE |
948 FUNNY_Y_CODE | 944 FUNNY_Y_CODE |
949 FUNNY_Y_CODE | 945 FUNNY_Y_CODE |
950 FUNNY_Y_CODE | 946 FUNNY_Y_CODE |
1044 "movl %3, %%edx \n\t" // (xInc*4)>>16 | 1040 "movl %3, %%edx \n\t" // (xInc*4)>>16 |
1045 "xorl %%ecx, %%ecx \n\t" | 1041 "xorl %%ecx, %%ecx \n\t" |
1046 "xorl %%ebx, %%ebx \n\t" | 1042 "xorl %%ebx, %%ebx \n\t" |
1047 "movw %4, %%bx \n\t" // (xInc*4)&0xFFFF | 1043 "movw %4, %%bx \n\t" // (xInc*4)&0xFFFF |
1048 | 1044 |
1049 #ifdef HAVE_MMX2 | |
1050 #define FUNNYUVCODE \ | 1045 #define FUNNYUVCODE \ |
1051 "prefetchnta 1024(%%esi) \n\t"\ | 1046 PREFETCH" 1024(%%esi) \n\t"\ |
1052 "prefetchnta 1056(%%esi) \n\t"\ | 1047 PREFETCH" 1056(%%esi) \n\t"\ |
1053 "prefetchnta 1088(%%esi) \n\t"\ | 1048 PREFETCH" 1088(%%esi) \n\t"\ |
1054 "call funnyUVCode \n\t"\ | 1049 "call funnyUVCode \n\t"\ |
1055 "movq temp0, %%mm2 \n\t"\ | 1050 "movq temp0, %%mm2 \n\t"\ |
1056 "xorl %%ecx, %%ecx \n\t" | 1051 "xorl %%ecx, %%ecx \n\t" |
1057 #else | |
1058 #define FUNNYUVCODE \ | |
1059 "call funnyUVCode \n\t"\ | |
1060 "movq temp0, %%mm2 \n\t"\ | |
1061 "xorl %%ecx, %%ecx \n\t" | |
1062 #endif | |
1063 | 1052 |
1064 FUNNYUVCODE | 1053 FUNNYUVCODE |
1065 FUNNYUVCODE | 1054 FUNNYUVCODE |
1066 FUNNYUVCODE | 1055 FUNNYUVCODE |
1067 FUNNYUVCODE | 1056 FUNNYUVCODE |
1437 g16Dither= g16Dither1; | 1426 g16Dither= g16Dither1; |
1438 g16Dither1= g16Dither2; | 1427 g16Dither1= g16Dither2; |
1439 g16Dither2= g16Dither; | 1428 g16Dither2= g16Dither; |
1440 #endif | 1429 #endif |
1441 } | 1430 } |
1442 | 1431 __asm __volatile(SFENCE:::"memory"); |
1443 #ifdef HAVE_3DNOW | 1432 __asm __volatile(EMMS:::"memory"); |
1444 asm volatile("femms"); | |
1445 #elif defined (HAVE_MMX) | |
1446 asm volatile("emms"); | |
1447 #endif | |
1448 } | 1433 } |
1449 | 1434 |
1450 | 1435 |
1451 void SwScale_Init(){ | 1436 void SwScale_Init(){ |
1452 // generating tables: | 1437 // generating tables: |