2 * (C) GraÅžvydas "notaz" Ignotas, 2011
4 * This work is licensed under the terms of any of these licenses
6 * - GNU GPL, version 2 or later.
7 * - GNU LGPL, version 2.1 or later.
8 * See the COPYING file in the top-level directory.
11 #include "arm_features.h"
16 ptr_ChanBuf: .word ESYM(ChanBuf)
22 .macro load_varadr reg var
23 #if defined(__ARM_ARCH_7A__) && !defined(__PIC__)
24 movw \reg, #:lower16:ESYM(\var)
25 movt \reg, #:upper16:ESYM(\var)
26 #elif defined(__ARM_ARCH_7A__) && defined(__MACH__)
27 movw \reg, #:lower16:(ptr_\var-(1678f+8))
28 movt \reg, #:upper16:(ptr_\var-(1678f+8))
38 FUNCTION(mix_chan): @ (int *SSumLR, int count, int lv, int rv)
40 vmov.32 d14[1], r3 @ multipliers
42 load_varadr r0, ChanBuf
46 vmul.s32 d10, d14, d0[0]
47 vmul.s32 d11, d14, d0[1]
48 vmul.s32 d12, d14, d1[0]
49 vmul.s32 d13, d14, d1[1]
68 FUNCTION(mix_chan_rvb): @ (int *SSumLR, int count, int lv, int rv, int *rvb)
70 vmov.32 d14[1], r3 @ multipliers
72 load_varadr r0, ChanBuf
78 vmul.s32 d10, d14, d0[0]
79 vmul.s32 d11, d14, d0[1]
80 vmul.s32 d12, d14, d1[0]
81 vmul.s32 d13, d14, d1[1]
105 #elif defined(HAVE_ARMV5)
107 FUNCTION(mix_chan): @ (int *SSumLR, int count, int lv, int rv)
108 stmfd sp!, {r4-r8,lr}
109 orr r3, r2, r3, lsl #16
110 lsl r3, #1 @ packed multipliers << 1
112 load_varadr r0, ChanBuf
116 lsl r4, #1 @ adjust for mul
118 smlawb r6, r4, r3, r6
119 smlawt r7, r4, r3, r7
120 smlawb r8, r5, r3, r8
121 smlawt lr, r5, r3, lr
124 stmia r2!, {r6-r8,lr}
126 ldmeqfd sp!, {r4-r8,pc}
130 ldmfd sp!, {r4-r8,pc}
133 FUNCTION(mix_chan_rvb): @ (int *SSumLR, int count, int lv, int rv, int *rvb)
134 stmfd sp!, {r4-r8,lr}
135 orr lr, r2, r3, lsl #16
138 load_varadr r0, ChanBuf
139 ldr r3, [sp, #6*4] @ rvb
145 smlawb r6, r4, lr, r6 @ supposedly takes single cycle?
146 smlawt r7, r4, lr, r7
147 smlawb r8, r4, lr, r8
148 smlawt r12,r4, lr, r12
153 ldmfd sp!, {r4-r8,pc}
157 @ vim:filetype=armasm