beta-0.89.2
[luatex.git] / source / libs / gmp / gmp-src / mpn / arm / v7a / cora15 / neon / com.asm
blob9e7a629287b6f1acaae6992b997845cc2eac0e5a
1 dnl ARM Neon mpn_com optimised for A15.
3 dnl Copyright 2013 Free Software Foundation, Inc.
5 dnl This file is part of the GNU MP Library.
6 dnl
7 dnl The GNU MP Library is free software; you can redistribute it and/or modify
8 dnl it under the terms of either:
9 dnl
10 dnl * the GNU Lesser General Public License as published by the Free
11 dnl Software Foundation; either version 3 of the License, or (at your
12 dnl option) any later version.
13 dnl
14 dnl or
15 dnl
16 dnl * the GNU General Public License as published by the Free Software
17 dnl Foundation; either version 2 of the License, or (at your option) any
18 dnl later version.
19 dnl
20 dnl or both in parallel, as here.
21 dnl
22 dnl The GNU MP Library is distributed in the hope that it will be useful, but
23 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25 dnl for more details.
26 dnl
27 dnl You should have received copies of the GNU General Public License and the
28 dnl GNU Lesser General Public License along with the GNU MP Library. If not,
29 dnl see https://www.gnu.org/licenses/.
31 include(`../config.m4')
33 C cycles/limb
34 C StrongARM ?
35 C XScale ?
36 C Cortex-A8 ?
37 C Cortex-A9 2.1
38 C Cortex-A15 0.65
40 define(`rp', `r0')
41 define(`up', `r1')
42 define(`n', `r2')
44 ASM_START()
45 PROLOGUE(mpn_com)
46 cmp n, #7
47 ble L(bc)
49 C Perform a few initial operation until rp is 128-bit aligned
50 tst rp, #4
51 beq L(al1)
52 vld1.32 {d0[0]}, [up]!
53 sub n, n, #1
54 vmvn d0, d0
55 vst1.32 {d0[0]}, [rp]!
56 L(al1): tst rp, #8
57 beq L(al2)
58 vld1.32 {d0}, [up]!
59 sub n, n, #2
60 vmvn d0, d0
61 vst1.32 {d0}, [rp:64]!
62 L(al2): vld1.32 {q2}, [up]!
63 subs n, n, #12
64 blt L(end)
66 ALIGN(16)
67 L(top): vld1.32 {q0}, [up]!
68 vmvn q2, q2
69 subs n, n, #8
70 vst1.32 {q2}, [rp:128]!
71 vld1.32 {q2}, [up]!
72 vmvn q0, q0
73 vst1.32 {q0}, [rp:128]!
74 bge L(top)
76 L(end): vmvn q2, q2
77 vst1.32 {q2}, [rp:128]!
79 C Handle last 0-7 limbs. Note that rp is aligned after loop, but not when we
80 C arrive here via L(bc)
81 L(bc): tst n, #4
82 beq L(tl1)
83 vld1.32 {q0}, [up]!
84 vmvn q0, q0
85 vst1.32 {q0}, [rp]!
86 L(tl1): tst n, #2
87 beq L(tl2)
88 vld1.32 {d0}, [up]!
89 vmvn d0, d0
90 vst1.32 {d0}, [rp]!
91 L(tl2): tst n, #1
92 beq L(tl3)
93 vld1.32 {d0[0]}, [up]
94 vmvn d0, d0
95 vst1.32 {d0[0]}, [rp]
96 L(tl3): bx lr
97 EPILOGUE()