summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2012-10-10 22:20:18 +0200
committerNils Wallménius <nils@rockbox.org>2012-10-10 22:52:11 +0200
commit2326f1517e77d4fb029113e8e75d347cf3adb8fb (patch)
tree740da8123bf6fdc16d781f712017c4ae854fe870 /lib
parente3e53c965a39b5b3108ffa46369d233d6a2f1ff6 (diff)
opus: cf asm for C_MULC
saves 2.7MHz decoding a 64kbps test file on h300 Change-Id: Id63791f79b44ed398ce5d341a5f5212d9a30282e
Diffstat (limited to 'lib')
-rw-r--r--lib/rbcodec/codecs/libopus/celt/_kiss_fft_guts.h21
1 files changed, 21 insertions, 0 deletions
diff --git a/lib/rbcodec/codecs/libopus/celt/_kiss_fft_guts.h b/lib/rbcodec/codecs/libopus/celt/_kiss_fft_guts.h
index 33e62c6b3d..6e806bbc23 100644
--- a/lib/rbcodec/codecs/libopus/celt/_kiss_fft_guts.h
+++ b/lib/rbcodec/codecs/libopus/celt/_kiss_fft_guts.h
@@ -61,9 +61,30 @@
do{ (m).r = SUB32(S_MUL((a).r,(b).r) , S_MUL((a).i,(b).i)); \
(m).i = ADD32(S_MUL((a).r,(b).i) , S_MUL((a).i,(b).r)); }while(0)
+#if defined (CPU_COLDFIRE)
+# define C_MULC(m,a,b) \
+ { \
+ asm volatile("move.l (%[bp]), %%d2;" \
+ "clr.l %%d3;" \
+ "move.w %%d2, %%d3;" \
+ "swap %%d3;" \
+ "clr.w %%d2;" \
+ "movem.l (%[ap]), %%d0-%%d1;" \
+ "mac.l %%d0, %%d2, %%acc0;" \
+ "mac.l %%d1, %%d3, %%acc0;" \
+ "mac.l %%d1, %%d2, %%acc1;" \
+ "msac.l %%d0, %%d3, %%acc1;" \
+ "movclr.l %%acc0, %[mr];" \
+ "movclr.l %%acc1, %[mi];" \
+ : [mr] "=r" ((m).r), [mi] "=r" ((m).i) \
+ : [ap] "a" (&(a)), [bp] "a" (&(b)) \
+ : "d0", "d1", "d2", "d3", "cc"); \
+ }
+#else
# define C_MULC(m,a,b) \
do{ (m).r = ADD32(S_MUL((a).r,(b).r) , S_MUL((a).i,(b).i)); \
(m).i = SUB32(S_MUL((a).i,(b).r) , S_MUL((a).r,(b).i)); }while(0)
+#endif
# define C_MUL4(m,a,b) \
do{ (m).r = SHR32(SUB32(S_MUL((a).r,(b).r) , S_MUL((a).i,(b).i)),2); \