Commit | Line | Data |
---|---|---|
2ba45a60 DM |
1 | /* |
2 | * ARM NEON optimised integer operations | |
3 | * Copyright (c) 2009 Konstantin Shishkov | |
4 | * | |
5 | * This file is part of FFmpeg. | |
6 | * | |
7 | * FFmpeg is free software; you can redistribute it and/or | |
8 | * modify it under the terms of the GNU Lesser General Public | |
9 | * License as published by the Free Software Foundation; either | |
10 | * version 2.1 of the License, or (at your option) any later version. | |
11 | * | |
12 | * FFmpeg is distributed in the hope that it will be useful, | |
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
15 | * Lesser General Public License for more details. | |
16 | * | |
17 | * You should have received a copy of the GNU Lesser General Public | |
18 | * License along with FFmpeg; if not, write to the Free Software | |
19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
20 | */ | |
21 | ||
22 | #include "libavutil/arm/asm.S" | |
23 | ||
24 | function ff_scalarproduct_int16_neon, export=1 | |
25 | vmov.i16 q0, #0 | |
26 | vmov.i16 q1, #0 | |
27 | vmov.i16 q2, #0 | |
28 | vmov.i16 q3, #0 | |
29 | 1: vld1.16 {d16-d17}, [r0]! | |
30 | vld1.16 {d20-d21}, [r1,:128]! | |
31 | vmlal.s16 q0, d16, d20 | |
32 | vld1.16 {d18-d19}, [r0]! | |
33 | vmlal.s16 q1, d17, d21 | |
34 | vld1.16 {d22-d23}, [r1,:128]! | |
35 | vmlal.s16 q2, d18, d22 | |
36 | vmlal.s16 q3, d19, d23 | |
37 | subs r2, r2, #16 | |
38 | bgt 1b | |
39 | ||
40 | vpadd.s32 d16, d0, d1 | |
41 | vpadd.s32 d17, d2, d3 | |
42 | vpadd.s32 d18, d4, d5 | |
43 | vpadd.s32 d19, d6, d7 | |
44 | vpadd.s32 d0, d16, d17 | |
45 | vpadd.s32 d1, d18, d19 | |
46 | vpadd.s32 d2, d0, d1 | |
47 | vpaddl.s32 d3, d2 | |
48 | vmov.32 r0, d3[0] | |
49 | bx lr | |
50 | endfunc | |
51 |