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

jm at svn.xiph.org jm at svn.xiph.org
Fri May 26 21:45:06 PDT 2006


Author: jm
Date: 2006-05-26 21:45:02 -0700 (Fri, 26 May 2006)
New Revision: 11437

Modified:
   trunk/speex/libspeex/fixed_bfin.h
Log:
normalize16() on Blackfin should now work on odd lenghts


Modified: trunk/speex/libspeex/fixed_bfin.h
===================================================================
--- trunk/speex/libspeex/fixed_bfin.h	2006-05-27 03:10:52 UTC (rev 11436)
+++ trunk/speex/libspeex/fixed_bfin.h	2006-05-27 04:45:02 UTC (rev 11437)
@@ -36,6 +36,30 @@
 #ifndef FIXED_BFIN_H
 #define FIXED_BFIN_H
 
+#undef PDIV32_16
+static inline spx_word16_t PDIV32_16(spx_word32_t a, spx_word16_t b)
+{
+   spx_word32_t res, bb;
+   bb = b;
+   __asm__  (
+         "P0 = 15;\n\t"
+         "R0 = %1;\n\t"
+         "R1 = %2;\n\t"
+         //"R0 = R0 + R1;\n\t"
+         "R0 <<= 1;\n\t"
+         "DIVS (R0, R1);\n\t"
+         "LOOP divide%= LC0 = P0;\n\t"
+         "LOOP_BEGIN divide%=;\n\t"
+            "DIVQ (R0, R1);\n\t"
+         "LOOP_END divide%=;\n\t"
+         "R0 = R0.L;\n\t"
+         "%0 = R0;\n\t"
+   : "=m" (res)
+   : "m" (a+(b>>1)), "m" (bb)
+   : "P0", "R0", "R1", "cc");
+   return res;
+}
+
 #undef DIV32_16
 static inline spx_word16_t DIV32_16(spx_word32_t a, spx_word16_t b)
 {



More information about the commits mailing list