blob: c348f30a78004fb0b9a9dd314f1871b9275330cd [file] [log] [blame]
Thomas Tsou7e4e5362013-10-30 21:18:55 -04001/*
2 * ARM NEON Scaling
3 * Copyright (C) 2013 Thomas Tsou <tom@tsou.cc>
4 *
Pau Espin Pedrol21d03d32019-07-22 12:05:52 +02005 * SPDX-License-Identifier: LGPL-2.1+
6 *
Thomas Tsou7e4e5362013-10-30 21:18:55 -04007 * This library 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 * This library 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.
Thomas Tsou7e4e5362013-10-30 21:18:55 -040016 */
17
18 .syntax unified
19 .text
20 .align 2
21 .global neon_scale_4n
22 .type neon_scale_4n, %function
23neon_scale_4n:
24 push {r4, lr}
25 ldr r4, =32
26
27 vld1.64 d0, [r1]
28 vmov.32 s4, s1
29 vmov.32 s1, s0
30 vmov.64 d1, d0
31 vmov.32 s5, s4
32 vmov.64 d3, d2
33.loop_mul_const:
34 vld2.32 {q2-q3}, [r0], r4
35
36 vmul.f32 q8, q0, q2
37 vmul.f32 q9, q1, q3
38 vmul.f32 q10, q0, q3
39 vmul.f32 q11, q1, q2
40 vsub.f32 q8, q8, q9
41 vadd.f32 q9, q10, q11
42
43 vst2.32 {q8-q9}, [r2]!
44 subs r3, #1
45 bne .loop_mul_const
46 pop {r4, pc}
47 .size neon_scale_4n, .-neon_scale_4n
48 .section .note.GNU-stack,"",%progbits