beta-0.89.2
[luatex.git] / source / libs / gmp / gmp-src / mpn / arm64 / bdiv_dbm1c.asm
blob3ccb2b60e5344982263a0e73a3d059b4998b3133
1 dnl ARM64 mpn_bdiv_dbm1c.
3 dnl Copyright 2008, 2011, 2012, 2014 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 Cortex-A53 ?
35 C Cortex-A57 ?
37 define(`qp', `x0')
38 define(`up', `x1')
39 define(`n', `x2')
40 define(`bd', `x3')
41 define(`cy', `x4')
43 ASM_START()
44 TEXT
45 ALIGN(16)
46 PROLOGUE(mpn_bdiv_dbm1c)
47 ldr x5, [up], #8
48 ands x6, n, #3
49 b.eq L(fi0)
50 cmp x6, #2
51 b.cc L(fi1)
52 b.eq L(fi2)
54 L(fi3): mul x12, x5, bd
55 umulh x13, x5, bd
56 ldr x5, [up], #8
57 b L(lo3)
59 L(fi0): mul x10, x5, bd
60 umulh x11, x5, bd
61 ldr x5, [up], #8
62 b L(lo0)
64 L(fi1): subs n, n, #1
65 mul x12, x5, bd
66 umulh x13, x5, bd
67 b.ls L(wd1)
68 ldr x5, [up], #8
69 b L(lo1)
71 L(fi2): mul x10, x5, bd
72 umulh x11, x5, bd
73 ldr x5, [up], #8
74 b L(lo2)
76 L(top): ldr x5, [up], #8
77 subs x4, x4, x10
78 str x4, [qp], #8
79 sbc x4, x4, x11
80 L(lo1): mul x10, x5, bd
81 umulh x11, x5, bd
82 ldr x5, [up], #8
83 subs x4, x4, x12
84 str x4, [qp], #8
85 sbc x4, x4, x13
86 L(lo0): mul x12, x5, bd
87 umulh x13, x5, bd
88 ldr x5, [up], #8
89 subs x4, x4, x10
90 str x4, [qp], #8
91 sbc x4, x4, x11
92 L(lo3): mul x10, x5, bd
93 umulh x11, x5, bd
94 ldr x5, [up], #8
95 subs x4, x4, x12
96 str x4, [qp], #8
97 sbc x4, x4, x13
98 L(lo2): subs n, n, #4
99 mul x12, x5, bd
100 umulh x13, x5, bd
101 b.hi L(top)
103 L(wd2): subs x4, x4, x10
104 str x4, [qp], #8
105 sbc x4, x4, x11
106 L(wd1): subs x4, x4, x12
107 str x4, [qp]
108 sbc x0, x4, x13
110 EPILOGUE()