diff options
-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 | ||