summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNils Wallménius <nils@rockbox.org>2010-06-17 16:49:39 +0000
committerNils Wallménius <nils@rockbox.org>2010-06-17 16:49:39 +0000
commit3d2b1cfa6e3307d3a97a055776ea342cd62f683e (patch)
tree2c499bb5441c7e825ccae84fd67de49df57983ff
parentb6c17c2c82602723a033298fafbc37b9462a9f34 (diff)
downloadrockbox-3d2b1cfa6e3307d3a97a055776ea342cd62f683e.tar.gz
rockbox-3d2b1cfa6e3307d3a97a055776ea342cd62f683e.tar.bz2
rockbox-3d2b1cfa6e3307d3a97a055776ea342cd62f683e.zip
ARMv6 vector mutiplication asm, speeds up vorbis decoding about 0.1MHz on gigabeat S.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@26892 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/codecs/libtremor/asm_arm.h50
1 files changed, 50 insertions, 0 deletions
diff --git a/apps/codecs/libtremor/asm_arm.h b/apps/codecs/libtremor/asm_arm.h
index ada0604a3a..683de7bf64 100644
--- a/apps/codecs/libtremor/asm_arm.h
+++ b/apps/codecs/libtremor/asm_arm.h
@@ -112,6 +112,32 @@ void vect_add_left_right(ogg_int32_t *x, const ogg_int32_t *y, int n)
} while (n);
}
+#if ARM_ARCH >= 6
+static inline
+void vect_mult_fw(ogg_int32_t *data, LOOKUP_T *window, int n)
+{
+ /* Note, mult_fw uses MULT31 */
+ do{
+ asm volatile (
+ "ldmia %[d], {r0, r1, r2, r3};"
+ "ldmia %[w]!, {r4, r5, r6, r7};"
+ "smmul r0, r4, r0;"
+ "smmul r1, r5, r1;"
+ "smmul r2, r6, r2;"
+ "smmul r3, r7, r3;"
+ "mov r0, r0, lsl #1;"
+ "mov r1, r1, lsl #1;"
+ "mov r2, r2, lsl #1;"
+ "mov r3, r3, lsl #1;"
+ "stmia %[d]!, {r0, r1, r2, r3};"
+ : [d] "+r" (data), [w] "+r" (window)
+ : : "r0", "r1", "r2", "r3",
+ "r4", "r5", "r6", "r7",
+ "memory" );
+ n -= 4;
+ } while (n);
+}
+#else
static inline
void vect_mult_fw(ogg_int32_t *data, LOOKUP_T *window, int n)
{
@@ -136,7 +162,30 @@ void vect_mult_fw(ogg_int32_t *data, LOOKUP_T *window, int n)
n -= 4;
} while (n);
}
+#endif
+#if ARM_ARCH >= 6
+static inline
+void vect_mult_bw(ogg_int32_t *data, LOOKUP_T *window, int n)
+{
+ /* NOTE mult_bw uses MULT_32 i.e. doesn't shift result left at end */
+ /* On ARM, we can do the shift at the same time as the overlap-add */
+ do{
+ asm volatile ("ldmia %[d], {r0, r1, r2, r3};"
+ "ldmda %[w]!, {r4, r5, r6, r7};"
+ "smmul r0, r7, r0;"
+ "smmul r1, r6, r1;"
+ "smmul r2, r5, r2;"
+ "smmul r3, r4, r3;"
+ "stmia %[d]!, {r0, r1, r2, r3};"
+ : [d] "+r" (data), [w] "+r" (window)
+ : : "r0", "r1", "r2", "r3",
+ "r4", "r5", "r6", "r7",
+ "memory" );
+ n -= 4;
+ } while (n);
+}
+#else
static inline
void vect_mult_bw(ogg_int32_t *data, LOOKUP_T *window, int n)
{
@@ -157,6 +206,7 @@ void vect_mult_bw(ogg_int32_t *data, LOOKUP_T *window, int n)
n -= 4;
} while (n);
}
+#endif
static inline void vect_copy(ogg_int32_t *x, const ogg_int32_t *y, int n)
{