2 * ARM NEON optimised integer operations
3 * Copyright (c) 2009 Kostya Shishkov
5 * This file is part of FFmpeg.
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.
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.
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
22 #include "libavutil/arm/asm.S"
26 function ff_scalarproduct_int16_neon, export=1
31 1: vld1.16 {d16-d17}, [r0]!
32 vld1.16 {d20-d21}, [r1,:128]!
33 vmlal.s16 q0, d16, d20
34 vld1.16 {d18-d19}, [r0]!
35 vmlal.s16 q1, d17, d21
36 vld1.16 {d22-d23}, [r1,:128]!
37 vmlal.s16 q2, d18, d22
38 vmlal.s16 q3, d19, d23
46 vpadd.s32 d0, d16, d17
47 vpadd.s32 d1, d10, d11
54 @ scalarproduct_and_madd_int16(/*aligned*/v0,v1,v2,order,mul)
55 function ff_scalarproduct_and_madd_int16_neon, export=1
56 vld1.16 {d28[],d29[]}, [sp]
63 1: vld1.16 {d16-d17}, [r0,:128]!
64 vld1.16 {d18-d19}, [r1]!
65 vld1.16 {d20-d21}, [r2]!
66 vld1.16 {d22-d23}, [r0,:128]!
67 vld1.16 {d24-d25}, [r1]!
68 vld1.16 {d26-d27}, [r2]!
69 vmul.s16 q10, q10, q14
70 vmul.s16 q13, q13, q14
71 vmlal.s16 q0, d16, d18
72 vmlal.s16 q1, d17, d19
74 vadd.s16 q13, q11, q13
75 vmlal.s16 q2, d22, d24
76 vmlal.s16 q3, d23, d25
77 vst1.16 {q10}, [r12,:128]!
79 vst1.16 {q13}, [r12,:128]!
86 vpadd.s32 d0, d16, d17
87 vpadd.s32 d1, d10, d11