Filt_6k_7k_neon.s revision 97e3e847179c17eb9059fb322413b6facd3e5a03
1@/*
2@ ** Copyright 2003-2010, VisualOn, Inc.
3@ **
4@ ** Licensed under the Apache License, Version 2.0 (the "License");
5@ ** you may not use this file except in compliance with the License.
6@ ** You may obtain a copy of the License at
7@ **
8@ **     http://www.apache.org/licenses/LICENSE-2.0
9@ **
10@ ** Unless required by applicable law or agreed to in writing, software
11@ ** distributed under the License is distributed on an "AS IS" BASIS,
12@ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13@ ** See the License for the specific language governing permissions and
14@ ** limitations under the License.
15@ */
16@
17@**********************************************************************/
18@void Filt_6k_7k(
19@     Word16 signal[],                      /* input:  signal                  */
20@     Word16 lg,                            /* input:  length of input         */
21@     Word16 mem[]                          /* in/out: memory (size=30)        */
22@)
23@***********************************************************************
24@ r0    ---  signal[]
25@ r1    ---  lg
26@ r2    ---  mem[]
27
28          .section  .text
29          .global   Filt_6k_7k_asm
30          .extern   fir_6k_7k
31          .hidden   fir_6k_7k
32
33Filt_6k_7k_asm:
34
35          STMFD   		r13!, {r0 - r12, r14}
36          SUB    		r13, r13, #240              @ x[L_SUBFR16k + (L_FIR - 1)]
37          MOV     		r8, r0                      @ copy signal[] address
38          MOV     		r5, r2                      @ copy mem[] address
39
40          MOV     		r0, r2
41          MOV     		r1, r13
42
43	  VLD1.S16              {D0, D1, D2, D3}, [r0]!
44	  VLD1.S16              {D4, D5, D6, D7}, [r0]!
45
46	  VST1.S16              {D0, D1, D2, D3}, [r1]!
47	  VST1.S16              {D4, D5, D6}, [r1]!
48	  VST1.S16              D7[0], [r1]!
49	  VST1.S16              D7[1], [r1]!
50
51
52
53          ADR     		r3, Lable1                  @ get fir_7k address
54          LDR    		r10, [r3]
55          ADD    		r10, r3
56          MOV                   r3, r8                      @ change myMemCopy to Copy, due to Copy will change r3 content
57          ADD     	    	r6, r13, #60                @ get x[L_FIR - 1] address
58          MOV           	r7, r3                      @ get signal[i]
59          @for (i = lg - 1@ i >= 0@ i--)
60          @{
61          @     x[i + L_FIR - 1] = signal[i] >> 2@
62          @}
63	  VLD1.S16              {Q0, Q1}, [r7]!		    @ signal[0]  ~ signal[15]
64	  VLD1.S16              {Q2, Q3}, [r7]!             @ signal[16] ~ signal[31]
65          VLD1.S16              {Q4, Q5}, [r7]!             @ signal[32] ~ signal[47]
66	  VLD1.S16              {Q6, Q7}, [r7]!             @ signal[48] ~ signal[63]
67	  VLD1.S16              {Q8, Q9}, [r7]!             @ signal[64] ~ signal[79]
68	  VSHR.S16              Q10, Q0, #2
69          VSHR.S16              Q11, Q1, #2
70          VSHR.S16              Q12, Q2, #2
71	  VSHR.S16              Q13, Q3, #2
72	  VST1.S16              {Q10, Q11}, [r6]!
73	  VSHR.S16              Q0,  Q4, #2
74	  VSHR.S16              Q1,  Q5, #2
75	  VSHR.S16              Q10, Q6, #2
76	  VSHR.S16              Q11, Q7, #2
77	  VSHR.S16              Q2,  Q8, #2
78	  VSHR.S16              Q3,  Q9, #2
79	  VST1.S16              {Q12, Q13}, [r6]!
80	  VST1.S16              {Q0, Q1}, [r6]!
81	  VST1.S16              {Q10, Q11}, [r6]!
82	  VST1.S16              {Q2, Q3}, [r6]!
83
84	  MOV                   r12, r5
85          @STR     		r5, [sp, #-4]               @ PUSH  r5 to stack
86          @ not use registers: r4, r10, r12, r14, r5
87          MOV     		r4, r13
88          MOV     		r5, #0                      @ i = 0
89
90          @ r4 --- x[i], r10 ---- fir_6k_7k
91          VLD1.S16              {Q0, Q1}, [r10]!           @fir_6k_7k[0]  ~ fir_6k_7k[15]
92	  VLD1.S16              {Q2, Q3}, [r10]!           @fir_6k_7k[16] ~ fir_6k_7k[31]
93          VMOV.S16              D7[3], r5                        @set fir_6k_7K = 0
94
95	  VLD1.S16              {Q4, Q5}, [r4]!            @x[0]  ~ x[15]
96	  VLD1.S16              {Q6, Q7}, [r4]!            @x[16] ~ X[31]
97	  VLD1.S16              {Q8}, [r4]!
98          VMOV.S16              Q15, #0
99
100LOOP_6K7K:
101
102          VMULL.S16             Q9,D8,D0[0]
103          VMULL.S16             Q10,D9,D1[0]
104          VMULL.S16             Q11,D9,D0[0]
105          VMULL.S16             Q12,D10,D1[0]
106          VEXT.8                Q4,Q4,Q5,#2
107          VMLAL.S16             Q9,D10,D2[0]
108          VMLAL.S16             Q10,D11,D3[0]
109          VMLAL.S16             Q11,D11,D2[0]
110          VMLAL.S16             Q12,D12,D3[0]
111          VEXT.8                Q5,Q5,Q6,#2
112          VMLAL.S16             Q9,D12,D4[0]
113          VMLAL.S16             Q10,D13,D5[0]
114          VMLAL.S16             Q11,D13,D4[0]
115          VMLAL.S16             Q12,D14,D5[0]
116          VEXT.8                Q6,Q6,Q7,#2
117          VMLAL.S16             Q9,D14,D6[0]
118          VMLAL.S16             Q10,D15,D7[0]
119          VMLAL.S16             Q11,D15,D6[0]
120	  VMLAL.S16             Q12,D16,D7[0]
121	  VEXT.8  		Q7,Q7,Q8,#2
122
123	  VMLAL.S16 		Q9,D8,D0[1]
124	  VMLAL.S16     	Q10,D9,D1[1]
125	  VEXT.8 		Q8,Q8,Q15,#2
126	  VMLAL.S16 		Q11,D9,D0[1]
127	  VMLAL.S16 		Q12,D10,D1[1]
128	  VEXT.8  		Q4,Q4,Q5,#2
129	  VMLAL.S16 		Q9,D10,D2[1]
130	  VMLAL.S16 		Q10,D11,D3[1]
131	  VMLAL.S16 		Q11,D11,D2[1]
132	  VMLAL.S16 		Q12,D12,D3[1]
133	  VEXT.8  		Q5,Q5,Q6,#2
134	  VMLAL.S16 		Q9,D12,D4[1]
135	  VMLAL.S16 		Q10,D13,D5[1]
136	  VMLAL.S16 		Q11,D13,D4[1]
137	  VMLAL.S16 		Q12,D14,D5[1]
138	  VEXT.8  		Q6,Q6,Q7,#2
139	  VMLAL.S16 		Q9,D14,D6[1]
140	  VMLAL.S16 		Q10,D15,D7[1]
141	  VMLAL.S16 		Q11,D15,D6[1]
142	  VMLAL.S16 		Q12,D16,D7[1]
143	  VEXT.8  		Q7,Q7,Q8,#2
144
145	  VMLAL.S16 		Q9,D8,D0[2]
146	  VMLAL.S16 		Q10,D9,D1[2]
147	  VEXT.8 		Q8,Q8,Q15,#2
148	  VMLAL.S16 		Q11,D9,D0[2]
149	  VMLAL.S16 		Q12,D10,D1[2]
150	  VEXT.8  		Q4,Q4,Q5,#2
151	  VMLAL.S16 		Q9,D10,D2[2]
152	  VMLAL.S16 		Q10,D11,D3[2]
153	  VMLAL.S16 		Q11,D11,D2[2]
154	  VMLAL.S16 		Q12,D12,D3[2]
155	  VEXT.8  		Q5,Q5,Q6,#2
156	  VMLAL.S16 		Q9,D12,D4[2]
157	  VMLAL.S16 		Q10,D13,D5[2]
158	  VMLAL.S16 		Q11,D13,D4[2]
159	  VMLAL.S16 		Q12,D14,D5[2]
160	  VEXT.8  		Q6,Q6,Q7,#2
161	  VMLAL.S16 		Q9,D14,D6[2]
162	  VMLAL.S16 		Q10,D15,D7[2]
163	  VMLAL.S16 		Q11,D15,D6[2]
164	  VMLAL.S16 		Q12,D16,D7[2]
165	  VEXT.8  		Q7,Q7,Q8,#2
166
167	  VMLAL.S16 		Q9,D8,D0[3]
168	  VMLAL.S16 		Q10,D9,D1[3]
169	  VEXT.8 		Q8,Q8,Q15,#2
170	  VMLAL.S16 		Q11,D9,D0[3]
171	  VMLAL.S16 		Q12,D10,D1[3]
172	  VEXT.8  		Q4,Q4,Q5,#2
173	  VMLAL.S16 		Q9,D10,D2[3]
174	  VMLAL.S16 		Q10,D11,D3[3]
175	  VMLAL.S16 		Q11,D11,D2[3]
176	  VMLAL.S16 		Q12,D12,D3[3]
177	  VEXT.8  		Q5,Q5,Q6,#2
178	  VMLAL.S16 		Q9,D12,D4[3]
179	  VMLAL.S16 		Q10,D13,D5[3]
180	  VMLAL.S16 		Q11,D13,D4[3]
181	  VMLAL.S16 		Q12,D14,D5[3]
182	  VEXT.8  		Q6,Q6,Q7,#2
183	  VMLAL.S16 		Q9,D14,D6[3]
184	  VMLAL.S16 		Q10,D15,D7[3]
185	  VMLAL.S16 		Q11,D15,D6[3]
186	  VMLAL.S16 		Q12,D16,D7[3]
187	  VEXT.8 		Q7,Q7,Q8,#2
188
189	  VMOV.S16  		D8,D9
190	  VEXT.8 		Q8,Q8,Q15,#2
191	  VMOV.S16  		D9,D10
192	  VADD.S32  		Q9,Q9,Q10
193	  VMOV.S16  		D10,D11
194	  VMOV.S16  		D11,D12
195	  VADD.S32  		Q11,Q11,Q12
196	  VMOV.S16  		D12,D13
197	  VQRSHRN.S32 		D28,Q9,#15
198	  VMOV.S16  		D13,D14
199	  VMOV.S16  		D14,D15
200	  VQRSHRN.S32 		D29,Q11,#15
201	  VMOV.S16  		D15,D16
202
203	  VLD1.S16  		{Q8},[r4]!
204	  ADD                   r5, r5, #8
205	  CMP   		r5, #80
206	  VST1.S16  		{D28,D29},[r3]!
207	  BLT     		LOOP_6K7K
208
209          ADD     		r0, r13, #160               @x + lg
210	  MOV                   r1, r12
211	  @LDR     		r1, [sp, #-4]               @mem address
212
213	  VLD1.S16              {D0, D1, D2, D3}, [r0]!
214	  VLD1.S16              {D4, D5, D6, D7}, [r0]!
215
216	  VST1.S16              {D0, D1, D2, D3}, [r1]!
217	  VST1.S16              {D4, D5, D6}, [r1]!
218	  VST1.S16              D7[0], [r1]!
219	  VST1.S16              D7[1], [r1]!
220
221Filt_6k_7k_end:
222
223          ADD     		r13, r13, #240
224          LDMFD   		r13!, {r0 - r12, r15}
225
226Lable1:
227          .word   		fir_6k_7k-Lable1
228          @ENDFUNC
229          .END
230
231
232