mmx simplifications

git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@11649 b3059339-0415-0410-9bf9-f77b7e298cf2
This commit is contained in:
michael 2003-12-15 14:29:09 +00:00
parent 6629e2925b
commit cfeea2882d
1 changed files with 25 additions and 91 deletions

View File

@ -66,33 +66,15 @@ static void pack_nn_MMX(unsigned char *dst, unsigned char *y,
{ {
int j; int j;
asm volatile ("" asm volatile (""
"pxor %%mm0, %%mm0 \n\t"
".balign 16 \n\t" ".balign 16 \n\t"
"1: \n\t" "1: \n\t"
"movq (%0), %%mm1 \n\t" "movq (%0), %%mm1 \n\t"
"movq (%0), %%mm2 \n\t" "movq (%0), %%mm2 \n\t"
"punpcklbw %%mm0, %%mm1 \n\t" "movq (%1), %%mm4 \n\t"
"punpckhbw %%mm0, %%mm2 \n\t" "movq (%2), %%mm6 \n\t"
"punpcklbw %%mm6, %%mm4 \n\t"
"movq (%1), %%mm3 \n\t" "punpcklbw %%mm4, %%mm1 \n\t"
"movq (%2), %%mm5 \n\t" "punpckhbw %%mm4, %%mm2 \n\t"
"punpcklbw %%mm0, %%mm3 \n\t"
"punpcklbw %%mm0, %%mm5 \n\t"
"movq %%mm3, %%mm4 \n\t"
"movq %%mm5, %%mm6 \n\t"
"punpcklwd %%mm0, %%mm3 \n\t"
"punpckhwd %%mm0, %%mm4 \n\t"
"punpcklwd %%mm0, %%mm5 \n\t"
"punpckhwd %%mm0, %%mm6 \n\t"
"pslld $8, %%mm3 \n\t"
"pslld $8, %%mm4 \n\t"
"pslld $24, %%mm5 \n\t"
"pslld $24, %%mm6 \n\t"
"por %%mm3, %%mm1 \n\t"
"por %%mm4, %%mm2 \n\t"
"por %%mm5, %%mm1 \n\t"
"por %%mm6, %%mm2 \n\t"
"addl $8, %0 \n\t" "addl $8, %0 \n\t"
"addl $4, %1 \n\t" "addl $4, %1 \n\t"
@ -123,8 +105,6 @@ static void pack_li_0_MMX(unsigned char *dst, unsigned char *y,
".Lli0: \n\t" ".Lli0: \n\t"
"movq (%%esi), %%mm1 \n\t" "movq (%%esi), %%mm1 \n\t"
"movq (%%esi), %%mm2 \n\t" "movq (%%esi), %%mm2 \n\t"
"punpcklbw %%mm0, %%mm1 \n\t"
"punpckhbw %%mm0, %%mm2 \n\t"
"movq (%%eax,%%edx,2), %%mm4 \n\t" "movq (%%eax,%%edx,2), %%mm4 \n\t"
"movq (%%ebx,%%ebp,2), %%mm6 \n\t" "movq (%%ebx,%%ebp,2), %%mm6 \n\t"
@ -150,29 +130,17 @@ static void pack_li_0_MMX(unsigned char *dst, unsigned char *y,
"paddw %%mm5, %%mm6 \n\t" "paddw %%mm5, %%mm6 \n\t"
"psrlw $3, %%mm4 \n\t" "psrlw $3, %%mm4 \n\t"
"psrlw $3, %%mm6 \n\t" "psrlw $3, %%mm6 \n\t"
"movq %%mm4, %%mm3 \n\t" "packuswb %%mm4, %%mm4 \n\t"
"movq %%mm6, %%mm5 \n\t" "packuswb %%mm6, %%mm6 \n\t"
"punpcklwd %%mm0, %%mm3 \n\t" "punpcklbw %%mm6, %%mm4 \n\t"
"punpckhwd %%mm0, %%mm4 \n\t" "punpcklbw %%mm4, %%mm1 \n\t"
"punpcklwd %%mm0, %%mm5 \n\t" "punpckhbw %%mm4, %%mm2 \n\t"
"punpckhwd %%mm0, %%mm6 \n\t"
"pslld $8, %%mm3 \n\t"
"pslld $8, %%mm4 \n\t"
"pslld $24, %%mm5 \n\t"
"pslld $24, %%mm6 \n\t"
"por %%mm3, %%mm1 \n\t"
"por %%mm4, %%mm2 \n\t"
"por %%mm5, %%mm1 \n\t"
"por %%mm6, %%mm2 \n\t"
"movq %%mm1, (%%edi) \n\t" "movq %%mm1, (%%edi) \n\t"
"movq %%mm2, 8(%%edi) \n\t" "movq %%mm2, 8(%%edi) \n\t"
"movq 8(%%esi), %%mm1 \n\t" "movq 8(%%esi), %%mm1 \n\t"
"movq 8(%%esi), %%mm2 \n\t" "movq 8(%%esi), %%mm2 \n\t"
"punpcklbw %%mm0, %%mm1 \n\t"
"punpckhbw %%mm0, %%mm2 \n\t"
"movq (%%eax,%%edx,2), %%mm4 \n\t" "movq (%%eax,%%edx,2), %%mm4 \n\t"
"movq (%%ebx,%%ebp,2), %%mm6 \n\t" "movq (%%ebx,%%ebp,2), %%mm6 \n\t"
@ -198,21 +166,11 @@ static void pack_li_0_MMX(unsigned char *dst, unsigned char *y,
"paddw %%mm5, %%mm6 \n\t" "paddw %%mm5, %%mm6 \n\t"
"psrlw $3, %%mm4 \n\t" "psrlw $3, %%mm4 \n\t"
"psrlw $3, %%mm6 \n\t" "psrlw $3, %%mm6 \n\t"
"movq %%mm4, %%mm3 \n\t" "packuswb %%mm4, %%mm4 \n\t"
"movq %%mm6, %%mm5 \n\t" "packuswb %%mm6, %%mm6 \n\t"
"punpcklwd %%mm0, %%mm3 \n\t" "punpcklbw %%mm6, %%mm4 \n\t"
"punpckhwd %%mm0, %%mm4 \n\t" "punpcklbw %%mm4, %%mm1 \n\t"
"punpcklwd %%mm0, %%mm5 \n\t" "punpckhbw %%mm4, %%mm2 \n\t"
"punpckhwd %%mm0, %%mm6 \n\t"
"pslld $8, %%mm3 \n\t"
"pslld $8, %%mm4 \n\t"
"pslld $24, %%mm5 \n\t"
"pslld $24, %%mm6 \n\t"
"por %%mm3, %%mm1 \n\t"
"por %%mm4, %%mm2 \n\t"
"por %%mm5, %%mm1 \n\t"
"por %%mm6, %%mm2 \n\t"
"addl $16, %%esi \n\t" "addl $16, %%esi \n\t"
"addl $8, %%eax \n\t" "addl $8, %%eax \n\t"
@ -246,8 +204,6 @@ static void pack_li_1_MMX(unsigned char *dst, unsigned char *y,
".Lli1: \n\t" ".Lli1: \n\t"
"movq (%%esi), %%mm1 \n\t" "movq (%%esi), %%mm1 \n\t"
"movq (%%esi), %%mm2 \n\t" "movq (%%esi), %%mm2 \n\t"
"punpcklbw %%mm0, %%mm1 \n\t"
"punpckhbw %%mm0, %%mm2 \n\t"
"movq (%%eax,%%edx,2), %%mm4 \n\t" "movq (%%eax,%%edx,2), %%mm4 \n\t"
"movq (%%ebx,%%ebp,2), %%mm6 \n\t" "movq (%%ebx,%%ebp,2), %%mm6 \n\t"
@ -275,29 +231,17 @@ static void pack_li_1_MMX(unsigned char *dst, unsigned char *y,
"paddw %%mm5, %%mm6 \n\t" "paddw %%mm5, %%mm6 \n\t"
"psrlw $3, %%mm4 \n\t" "psrlw $3, %%mm4 \n\t"
"psrlw $3, %%mm6 \n\t" "psrlw $3, %%mm6 \n\t"
"movq %%mm4, %%mm3 \n\t" "packuswb %%mm4, %%mm4 \n\t"
"movq %%mm6, %%mm5 \n\t" "packuswb %%mm6, %%mm6 \n\t"
"punpcklwd %%mm0, %%mm3 \n\t" "punpcklbw %%mm6, %%mm4 \n\t"
"punpckhwd %%mm0, %%mm4 \n\t" "punpcklbw %%mm4, %%mm1 \n\t"
"punpcklwd %%mm0, %%mm5 \n\t" "punpckhbw %%mm4, %%mm2 \n\t"
"punpckhwd %%mm0, %%mm6 \n\t"
"pslld $8, %%mm3 \n\t"
"pslld $8, %%mm4 \n\t"
"pslld $24, %%mm5 \n\t"
"pslld $24, %%mm6 \n\t"
"por %%mm3, %%mm1 \n\t"
"por %%mm4, %%mm2 \n\t"
"por %%mm5, %%mm1 \n\t"
"por %%mm6, %%mm2 \n\t"
"movq %%mm1, (%%edi) \n\t" "movq %%mm1, (%%edi) \n\t"
"movq %%mm2, 8(%%edi) \n\t" "movq %%mm2, 8(%%edi) \n\t"
"movq 8(%%esi), %%mm1 \n\t" "movq 8(%%esi), %%mm1 \n\t"
"movq 8(%%esi), %%mm2 \n\t" "movq 8(%%esi), %%mm2 \n\t"
"punpcklbw %%mm0, %%mm1 \n\t"
"punpckhbw %%mm0, %%mm2 \n\t"
"movq (%%eax,%%edx,2), %%mm4 \n\t" "movq (%%eax,%%edx,2), %%mm4 \n\t"
"movq (%%ebx,%%ebp,2), %%mm6 \n\t" "movq (%%ebx,%%ebp,2), %%mm6 \n\t"
@ -325,21 +269,11 @@ static void pack_li_1_MMX(unsigned char *dst, unsigned char *y,
"paddw %%mm5, %%mm6 \n\t" "paddw %%mm5, %%mm6 \n\t"
"psrlw $3, %%mm4 \n\t" "psrlw $3, %%mm4 \n\t"
"psrlw $3, %%mm6 \n\t" "psrlw $3, %%mm6 \n\t"
"movq %%mm4, %%mm3 \n\t" "packuswb %%mm4, %%mm4 \n\t"
"movq %%mm6, %%mm5 \n\t" "packuswb %%mm6, %%mm6 \n\t"
"punpcklwd %%mm0, %%mm3 \n\t" "punpcklbw %%mm6, %%mm4 \n\t"
"punpckhwd %%mm0, %%mm4 \n\t" "punpcklbw %%mm4, %%mm1 \n\t"
"punpcklwd %%mm0, %%mm5 \n\t" "punpckhbw %%mm4, %%mm2 \n\t"
"punpckhwd %%mm0, %%mm6 \n\t"
"pslld $8, %%mm3 \n\t"
"pslld $8, %%mm4 \n\t"
"pslld $24, %%mm5 \n\t"
"pslld $24, %%mm6 \n\t"
"por %%mm3, %%mm1 \n\t"
"por %%mm4, %%mm2 \n\t"
"por %%mm5, %%mm1 \n\t"
"por %%mm6, %%mm2 \n\t"
"addl $16, %%esi \n\t" "addl $16, %%esi \n\t"
"addl $8, %%eax \n\t" "addl $8, %%eax \n\t"