2 @ ** Copyright 2003-2010, VisualOn, Inc.
\r
4 @ ** Licensed under the Apache License, Version 2.0 (the "License");
\r
5 @ ** you may not use this file except in compliance with the License.
\r
6 @ ** You may obtain a copy of the License at
\r
8 @ ** http://www.apache.org/licenses/LICENSE-2.0
\r
10 @ ** Unless required by applicable law or agreed to in writing, software
\r
11 @ ** distributed under the License is distributed on an "AS IS" BASIS,
\r
12 @ ** WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
\r
13 @ ** See the License for the specific language governing permissions and
\r
14 @ ** limitations under the License.
\r
17 @Word32 Dot_product12( /* (o) Q31: normalized result (1 < val <= -1) */
\r
18 @ Word16 x[], /* (i) 12bits: x vector */
\r
19 @ Word16 y[], /* (i) 12bits: y vector */
\r
20 @ Word16 lg, /* (i) : vector length */
\r
21 @ Word16 * exp /* (o) : exponent of result (0..+30) */
\r
23 @****************************************************************
\r
30 .global Dot_product12_asm
\r
34 STMFD r13!, {r4 - r12, r14}
\r
35 MOV r4, #0 @ L_sum = 0
\r
42 SMLABB r4, r6, r7, r4
\r
44 SMLATT r4, r6, r7, r4
\r
47 SMLABB r4, r8, r9, r4
\r
50 SMLATT r4, r8, r9, r4
\r
53 SMLABB r4, r6, r7, r4
\r
55 SMLATT r4, r6, r7, r4
\r
57 SMLABB r4, r8, r9, r4
\r
59 SMLATT r4, r8, r9, r4
\r
63 ADD r12, r12, #1 @ L_sum = (L_sum << 1) + 1
\r
69 SUB r10, r10, #1 @ sft = norm_l(L_sum)
\r
70 MOV r0, r12, LSL r10 @ L_sum = L_sum << sft
\r
71 RSB r11, r10, #30 @ *exp = 30 - sft
\r
76 LDMFD r13!, {r4 - r12, r15}
\r