[xiph-commits] r9411 - trunk/speex/libspeex

jm at motherfish-iii.xiph.org jm at motherfish-iii.xiph.org
Wed Jun 8 21:30:42 PDT 2005


Author: jm
Date: 2005-06-08 21:30:39 -0700 (Wed, 08 Jun 2005)
New Revision: 9411

Modified:
   trunk/speex/libspeex/filters_bfin.h
Log:
Cleanup in filter_mem2


Modified: trunk/speex/libspeex/filters_bfin.h
===================================================================
--- trunk/speex/libspeex/filters_bfin.h	2005-06-09 04:05:28 UTC (rev 9410)
+++ trunk/speex/libspeex/filters_bfin.h	2005-06-09 04:30:39 UTC (rev 9411)
@@ -88,7 +88,7 @@
    spx_word32_t xy2[N+1];
    spx_word32_t *xy = xy2+1;
    spx_word32_t numden_a[2*ord+2];
-   spx_word16_t *numden = (spx_word16_t *)numden_a;
+   spx_word16_t *numden = (spx_word16_t*) numden_a;
    int i;
    for (i=0;i<ord;i++)
    {
@@ -98,9 +98,9 @@
    __asm__ __volatile__
    (
    /* Register setup */
-   "R0 = %7;\n\t"      /*ord */
+   "R0 = %5;\n\t"      /*ord */
    
-   "P0 = %4;\n\t"
+   "P0 = %3;\n\t"
    "I0 = P0;\n\t"
    "B0 = P0;\n\t"
    "L0 = 0;\n\t"
@@ -109,9 +109,9 @@
    "I2 = P2;\n\t"
    "L2 = 0;\n\t"
    
-   "P4 = %8;\n\t"
-   "P0 = %2;\n\t"
-   "P1 = %3;\n\t"
+   "P4 = %6;\n\t"
+   "P0 = %1;\n\t"
+   "P1 = %2;\n\t"
    
    /* First sample */
    "R1 = [P4++];\n\t"
@@ -144,54 +144,60 @@
       "LOOP_BEGIN filter_start_inner%=;\n\t"
          "A0 += R4.L*R5.L (IS), A1 -= R4.H*R5.H (IS) || R4 = [I0++] || R5 = [I2--];\n\t"
       "LOOP_END filter_start_inner%=;\n\t"
-      "A0 += A1;A1=A0;\n\t"
-      "R1 = A1;\n\t"
-      "R1 <<= 1;\n\t"
+      "A0 += A1;\n\t"
+      "R4 = A0;\n\t"
+      "R4 <<= 1;\n\t"
       "R2 = [P0++];\n\t"
-      "R1 = R1 + R2;\n\t"
-      "[P1++] = R1;\n\t"
-      "R1 <<= 2;\n\t"
+      "R4 = R4 + R2;\n\t"
+      "[P1++] = R4;\n\t"
+      "R4 <<= 2;\n\t"
       "R2 <<= 2;\n\t"
-      "R2 = PACK(R1.H, R2.H);\n\t"
+      "R2 = PACK(R4.H, R2.H);\n\t"
       "[P2] = R2;\n\t"
 
    "LOOP_END filter_start%=;\n\t"
 
    /* Samples ord to N*/   
-   "R0 = %7;\n\t"
+   "R0 = %5;\n\t"
+   "R0 <<= 1;\n\t"
    "I0 = B0;\n\t"
-   "R0 <<= 2;\n\t"   
+   "R0 <<= 1;\n\t"   
    "L0 = R0;\n\t"
    
-   "P3 = %7;\n\t"
-   "R2 = %6;\n\t"
+   "R0 = %5;\n\t"
+   "R2 = %4;\n\t"
    "R2 = R2 - R0;\n\t"
    "R4 = [I0++];\n\t"
+   "LC0 = R2;\n\t"
+   "P3 = R0;\n\t"
+   "R0 <<= 2;\n\t"
+   "R0 += 8;\n\t"
+   "I2 = P2;\n\t"
+   "M0 = R0;\n\t"
    "A0 = A1 = 0;\n\t"
-   "LC0 = R2;\n\t"
+   "R5 = [I2--];\n\t"
    "LOOP filter_mid%= LC0;\n\t"
    "LOOP_BEGIN filter_mid%=;\n\t"
-      "I2 = P2;\n\t"
-      "P2 += 4;\n\t"
-      "R5 = [I2--];\n\t"
-      "LOOP filter_mid_inner%= LC1 = P3;\n\t"
+      "LOOP filter_mid_inner%= LC1=P3;\n\t"
       "LOOP_BEGIN filter_mid_inner%=;\n\t"
          "A0 += R4.L*R5.L (IS), A1 -= R4.H*R5.H (IS) || R4 = [I0++] || R5 = [I2--];\n\t"
       "LOOP_END filter_mid_inner%=;\n\t"
-      "R4 = (A0 += A1);\n\t"
-      "R4 = R4 << 1 || R2 = [P0++];\n\t"
-      "R4 = R4 + R2;\n\t"
-      "R4 = R4 << 2 || [P1++] = R1;\n\t"
-      "R2 = R2 << 2 ;\n\t"
-      "R2 = PACK(R4.H, R2.H);\n\t"
-      "A0 = A1 = 0 || [P2] = R2;\n\t"
-
-   "LOOP_END filter_mid%=;\n\t"
-     
+      "R0 = (A0 += A1) || I2 += M0;\n\t"
+      "R0 = R0 << 1 || R5 = [P0++];\n\t"
+      "R0 = R0 + R5;\n\t"
+      "R0 = R0 << 2 || [P1++] = R0;\n\t"
+      "R5 = R5 << 2;\n\t"
+      "R5 = PACK(R0.H, R5.H);\n\t"
+      "A0 = A1 = 0 || [I2--] = R5\n\t"
+      "LOOP_END filter_mid%=;\n\t"
+   "I2 += 4;\n\t"
+   "P2 = I2;\n\t"
    /* Update memory */
-   "P4 = %8;\n\t"
+   "P4 = %6;\n\t"
+   "R0 = %5;\n\t"
+   "LC0 = R0;\n\t"
    "P0 = B0;\n\t"
-   "LOOP mem_update%= LC0 = P3;\n\t"
+   "LOOP mem_update%= LC0;\n\t"
    "LOOP_BEGIN mem_update%=;\n\t"
       "A0 = A1 = 0;\n\t"
       "I2 = P2;\n\t"
@@ -199,7 +205,8 @@
       "P0 += 4;\n\t"
       "R0 = LC0;\n\t"
       "LC1=R0;\n\t"
-      "R5 = [I2--] || R4 = [I0++];\n\t"
+      "R5 = [I2--];\n\t"
+      "R4 = [I0++];\n\t"
       "LOOP mem_accum%= LC1;\n\t"
       "LOOP_BEGIN mem_accum%=;\n\t"
          "A0 += R4.L*R5.L (IS), A1 -= R4.H*R5.H (IS) || R4 = [I0++] || R5 = [I2--];\n\t"
@@ -209,8 +216,8 @@
       "[P4++] = R0;\n\t"
    "LOOP_END mem_update%=;\n\t"
 
-   : : "m" (xy), "m" (0), "m" (_x), "m" (_y), "m" (numden), "m" (0), "m" (N), "m" (ord), "m" (mem)
-   : "R0", "R1", "R2", "R3", "R4", "R5", "R7", "P0", "P1", "P2", "P3", "P4", "B0", "B1", "I0", "I1", "I2", "I3", "L0", "L1", "L2", "L3", "memory"
+   : : "m" (xy), "m" (_x), "m" (_y), "m" (numden), "m" (N), "m" (ord), "m" (mem)
+   : "R0", "R1", "R2", "R3", "R4", "R5", "R7", "P0", "P1", "P2", "P3", "P4", "B0", "I0", "I2", "L0", "L2", "M0", "memory"
    );
 
 }



More information about the commits mailing list