diff options
author | Nils Wallménius <nils@rockbox.org> | 2011-09-23 14:01:48 +0000 |
---|---|---|
committer | Nils Wallménius <nils@rockbox.org> | 2011-09-23 14:01:48 +0000 |
commit | d1e241f55a4b09149019d459f4db1ae79e6d8c1b (patch) | |
tree | 0fceedb39a1348d3158c72e353d4987aa1026b38 | |
parent | 2abb52a0840dcc613aded5d3ef16c7575e6816e3 (diff) | |
download | rockbox-d1e241f55a4b09149019d459f4db1ae79e6d8c1b.tar.gz rockbox-d1e241f55a4b09149019d459f4db1ae79e6d8c1b.zip |
libtremor: arm asm for ff_vector_fmul_window_c on v4 and v5 cores, speeds up c200v1 and fuzev1 by ~0.4MHz and ipod classic by ~1MHz.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@30584 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/codecs/libtremor/asm_arm.h | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/apps/codecs/libtremor/asm_arm.h b/apps/codecs/libtremor/asm_arm.h index 42f82ec088..42834a2581 100644 --- a/apps/codecs/libtremor/asm_arm.h +++ b/apps/codecs/libtremor/asm_arm.h | |||
@@ -16,7 +16,55 @@ | |||
16 | ********************************************************************/ | 16 | ********************************************************************/ |
17 | 17 | ||
18 | #ifdef _ARM_ASSEM_ | 18 | #ifdef _ARM_ASSEM_ |
19 | #if ARM_ARCH < 6 | ||
20 | #define INCL_OPTIMIZED_VECTOR_FMUL_WINDOW | ||
21 | static inline void ff_vector_fmul_window_c(ogg_int32_t *dst, const ogg_int32_t *src0, | ||
22 | const ogg_int32_t *src1, const ogg_int32_t *win, int len) | ||
23 | { | ||
24 | /* len is always a power of 2 and always >= 16 so this is unrolled 2 times*/ | ||
25 | ogg_int32_t *dst0 = dst, *dst1 = dst + 2*len; | ||
26 | const ogg_int32_t *win0 = win, *win1 = win + 2*len; | ||
27 | src1 += len; | ||
28 | asm volatile ("cmp %[len], #0\n\t" | ||
29 | "b 1f\n\t" | ||
30 | "0:\n\t" | ||
31 | "ldr r0, [%[src0]], #4\n\t" | ||
32 | "ldr r1, [%[src1], #-4]!\n\t" | ||
33 | "ldr r2, [%[win0]], #4\n\t" | ||
34 | "ldr r3, [%[win1], #-4]!\n\t" | ||
35 | "smull r4, r5, r0, r2\n\t" | ||
36 | "smlal r4, r5, r1, r3\n\t" | ||
37 | "rsb r2, r2, #0\n\t" | ||
38 | "lsl r5, r5, #1\n\t" | ||
39 | "str r5, [%[dst1], #-4]!\n\t" | ||
40 | "smull r4, r5, r0, r3\n\t" | ||
41 | "smlal r4, r5, r1, r2\n\t" | ||
42 | "ldr r0, [%[src0]], #4\n\t" | ||
43 | "ldr r1, [%[src1], #-4]!\n\t" | ||
44 | "lsl r5, r5, #1\n\t" | ||
45 | "str r5, [%[dst0]], #4\n\t" | ||
19 | 46 | ||
47 | "ldr r2, [%[win0]], #4\n\t" | ||
48 | "ldr r3, [%[win1], #-4]!\n\t" | ||
49 | "smull r4, r5, r0, r2\n\t" | ||
50 | "smlal r4, r5, r1, r3\n\t" | ||
51 | "rsb r2, r2, #0\n\t" | ||
52 | "lsl r5, r5, #1\n\t" | ||
53 | "str r5, [%[dst1], #-4]!\n\t" | ||
54 | "smull r4, r5, r0, r3\n\t" | ||
55 | "smlal r4, r5, r1, r2\n\t" | ||
56 | "subs %[len], %[len], #2\n\t" | ||
57 | "lsl r5, r5, #1\n\t" | ||
58 | "str r5, [%[dst0]], #4\n\t" | ||
59 | "1:\n\t" | ||
60 | "bgt 0b\n\t" | ||
61 | : [dst0] "+r" (dst0), [dst1] "+r" (dst1), | ||
62 | [src0] "+r" (src0), [src1] "+r" (src1), | ||
63 | [win0] "+r" (win0), [win1] "+r" (win1), | ||
64 | [len] "+r" (len) | ||
65 | :: "r0", "r1", "r2", "r3", "r4", "r5", "cc", "memory"); | ||
66 | } | ||
67 | #endif | ||
20 | #ifndef _V_LSP_MATH_ASM | 68 | #ifndef _V_LSP_MATH_ASM |
21 | #define _V_LSP_MATH_ASM | 69 | #define _V_LSP_MATH_ASM |
22 | 70 | ||