all repos — mgba @ 5ceec845601788b9d9d3862555380793457fdc44

mGBA Game Boy Advance Emulator

src/util/arm-algo.S (view raw)

 1# Copyright (c) 2013-2015 Jeffrey Pfau
 2#
 3# This Source Code Form is subject to the terms of the Mozilla Public
 4# License, v. 2.0. If a copy of the MPL was not distributed with this
 5# file, You can obtain one at http://mozilla.org/MPL/2.0/.
 6#if defined(__ARM_NEON) && !defined(PSP2)
 7# r0: Destination
 8# r1: Source
 9# r2: Width
10# r3: Height
11.global _neon2x
12_neon2x:
13push {r4-r5}
14lsl r4, r2, #2
15.n20:
16mov r2, r4, lsr #4
17add r5, r0, r4
18.n21:
19vld2.32 {d0[], d1[]}, [r1]!
20vmov d2, d0
21vmov d3, d1
22vzip.16 d0, d2
23vzip.16 d1, d3
24vst1.32 {q0}, [r0]!
25vst1.32 {q0}, [r5]!
26subs r2, #1
27bne .n21
28subs r3, #1
29mov r0, r5
30bne .n20
31pop {r4-r5}
32bx lr
33
34.global _neon4x
35_neon4x:
36push {r4-r7}
37lsl r4, r2, #3
38.n40:
39mov r2, r4, lsr #5
40add r5, r0, r4
41add r6, r5, r4
42add r7, r6, r4
43.n41:
44vld4.16 {d0[], d1[], d2[], d3[]}, [r1]!
45vst1.16 {d0}, [r0]!
46vst1.16 {d0}, [r5]!
47vst1.16 {d0}, [r6]!
48vst1.16 {d0}, [r7]!
49vst1.16 {d1}, [r0]!
50vst1.16 {d1}, [r5]!
51vst1.16 {d1}, [r6]!
52vst1.16 {d1}, [r7]!
53vst1.16 {d2}, [r0]!
54vst1.16 {d2}, [r5]!
55vst1.16 {d2}, [r6]!
56vst1.16 {d2}, [r7]!
57vst1.16 {d3}, [r0]!
58vst1.16 {d3}, [r5]!
59vst1.16 {d3}, [r6]!
60vst1.16 {d3}, [r7]!
61subs r2, #1
62bne .n41
63subs r3, #1
64mov r0, r7
65bne .n40
66pop {r4-r7}
67bx lr
68#endif
69
70.section	.note.GNU-stack,"",%progbits