Update of /cvsroot/alsa/alsa-lib/src/pcm
In directory sc8-pr-cvs1:/tmp/cvs-serv11956

Modified Files:
        pcm_dmix_i386.h 
Log Message:
fixed 32bit sample dmix code for i386.



Index: pcm_dmix_i386.h
===================================================================
RCS file: /cvsroot/alsa/alsa-lib/src/pcm/pcm_dmix_i386.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- pcm_dmix_i386.h     18 Mar 2003 18:00:20 -0000      1.7
+++ pcm_dmix_i386.h     17 Sep 2003 15:39:12 -0000      1.8
@@ -288,11 +288,15 @@
                "\t" LOCK_PREFIX "cmpxchgl %%ecx, (%%edi)\n"
                "\tjnz 2f\n"
                "\tmovl (%%esi), %%ecx\n"
-               "\tshr $8, %%ecx\n"
+               /* sample >>= 8 */
+               "\tsarl $8, %%ecx\n"
                "\tsubl %%edx, %%ecx\n"
+               "\tjmp 21f\n"
                "2:"
                "\tmovl (%%esi), %%ecx\n"
-               "\tshr $8, %%ecx\n"
+               /* sample >>= 8 */
+               "\tsarl $8, %%ecx\n"
+               "21:"
                "\t" LOCK_PREFIX "addl %%ecx, (%%ebx)\n"
 
                /*
@@ -305,53 +309,31 @@
 
                "3:"
                "\tmovl (%%ebx), %%ecx\n"
-               "\tcmpl $0x7fffff,%%ecx\n"
-               "\tjg 4f\n"
-               "\tcmpl $-0x800000,%%ecx\n"
-               "\tjl 5f\n"
-               "\tmov %%ecx, %%eax\n"
-               "\tshl $8, %%eax\n"
-               "\tmovl %%eax, (%%edi)\n"
-               "\tcmpl %%ecx, (%%ebx)\n"
-               "\tjnz 3b\n"
-
                /*
-                * while (size-- > 0)
+                *  if (sample > 0x7fff00)
                 */
-               "\tadd %4, %%edi\n"
-               "\tadd %5, %%esi\n"
-               "\tadd %6, %%ebx\n"
-               "\tdecl %0\n"
-               "\tjnz 1b\n"
-               "\tjmp 6f\n"
-
+               "\tmovl $0x7fffff, %%eax\n"
+               "\tcmpl %%eax, %%ecx\n"
+               "\tjg 4f\n"
                /*
-                *  sample > 0x7fff00
+                *  if (sample < -0x800000)
                 */
-
-               "\t.p2align 4,,15\n"
-
+               "\tmovl $-0x800000, %%eax\n"
+               "\tcmpl %%eax, %%ecx\n"
+               "\tjl 4f\n"
+               "\tmovl %%ecx, %%eax\n"
                "4:"
-               "\tmovl $0x7fffffff, (%%edi)\n"
-               "\tcmpl %%ecx,(%%ebx)\n"
-               "\tjnz 3b\n"
-               "\tadd %4, %%edi\n"
-               "\tadd %5, %%esi\n"
-               "\tadd %6, %%ebx\n"
-               "\tdecl %0\n"
-               "\tjnz 1b\n"
-               "\tjmp 6f\n"
-
                /*
-                *  sample < -0x800000
+                *  sample <<= 8;
                 */
-
-               "\t.p2align 4,,15\n"
-
-               "5:"
-               "\tmovl $-0x80000000, (%%edi)\n"
+               "\tsall $8, %%eax\n"
+               "\tmovl %%eax, (%%edi)\n"
                "\tcmpl %%ecx, (%%ebx)\n"
                "\tjnz 3b\n"
+
+               /*
+                * while (size-- > 0)
+                */
                "\tadd %4, %%edi\n"
                "\tadd %5, %%esi\n"
                "\tadd %6, %%ebx\n"
@@ -360,7 +342,6 @@
                // "\tjmp 6f\n"
                
                "6:"
-
                : /* no output regs */
                : "m" (size), "m" (dst), "m" (src), "m" (sum), "m" (dst_step), "m" 
(src_step), "m" (sum_step)
                : "esi", "edi", "edx", "ecx", "ebx", "eax"



-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Alsa-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/alsa-cvslog

Reply via email to