1 dnl ARM Neon mpn_rsh1add_n
, mpn_rsh1sub_n.
3 dnl Contributed to the GNU project by Torbjörn Granlund.
5 dnl Copyright
2013 Free Software Foundation
, Inc.
7 dnl
This file is part of the GNU MP Library.
9 dnl The GNU MP Library is free software
; you can redistribute it and/or modify
10 dnl it under the terms of
either:
12 dnl
* the GNU Lesser General
Public License as published by the Free
13 dnl Software Foundation
; either version 3 of the License, or (at your
14 dnl option
) any later version.
18 dnl
* the GNU General
Public License as published by the Free Software
19 dnl Foundation
; either version 2 of the License, or (at your option) any
22 dnl
or both
in parallel
, as here.
24 dnl The GNU MP Library is distributed
in the hope that it will be useful
, but
25 dnl WITHOUT ANY WARRANTY
; without even the implied warranty of MERCHANTABILITY
26 dnl
or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
Public License
29 dnl You should have received copies of the GNU General
Public License
and the
30 dnl GNU Lesser General
Public License along with the GNU MP Library. If
not,
31 dnl see
https://www.gnu.
org/licenses
/.
33 include(`..
/config.m4
')
44 C * Try to make this smaller, its size (384 bytes) is excessive.
45 C * Try to reach 2.25 c/l on A15, to match the addlsh_1 family.
46 C * This is ad-hoc scheduled, perhaps unnecessarily so for A15, and perhaps
47 C insufficiently for A7 and A8.
54 ifdef(`OPERATION_rsh1add_n', `
55 define
(`ADDSUBS
', `adds $1, $2, $3')
56 define
(`ADCSBCS
', `adcs $1, $2, $3')
59 define
(`func
', mpn_rsh1add_n)')
60 ifdef
(`OPERATION_rsh1sub_n
', `
61 define(`ADDSUBS', `subs
$1, $2, $3')
62 define(`ADCSBCS', `sbcs
$1, $2, $3')
65 define(`func', mpn_rsh1sub_n
)')
67 MULFUNC_PROLOGUE(mpn_rsh1add_n mpn_rsh1sub_n)
79 L(b11): ldmia up!, {r9,r10,r12}
83 ADCSBCS( r10, r10, r6)
84 ADCSBCS( r12, r12, r7)
92 L(gt3): ldmia up!, {r8,r9,r10,r12}
93 ldmia vp!, {r4,r5,r6,r7}
96 L(b10): ldmia up!, {r10,r12}
98 ADDSUBS( r10, r10, r6)
99 ADCSBCS( r12, r12, r7)
104 L(gt2): ldmia up!, {r8,r9,r10,r12}
105 ldmia vp!, {r4,r5,r6,r7}
108 L(b01): ldr r12, [up], #4
110 ADDSUBS( r12, r12, r7)
115 IFADD(` adc r1, n, #0')
116 IFSUB
(`
adc r1
, n
, #
1')
122 L(gt1): ldmia up!, {r8,r9,r10,r12}
123 ldmia vp!, {r4,r5,r6,r7}
128 ADCSBCS( r10, r10, r6)
129 ADCSBCS( r12, r12, r7)
135 L(b00): ldmia up!, {r8,r9,r10,r12}
136 ldmia vp!, {r4,r5,r6,r7}
140 ADCSBCS( r10, r10, r6)
141 ADCSBCS( r12, r12, r7)
146 L(top): ldmia up!, {r8,r9,r10,r12}
147 ldmia vp!, {r4,r5,r6,r7}
151 L(mi0): ADCSBCS( r8, r8, r4)
154 ADCSBCS( r10, r10, r6)
155 ADCSBCS( r12, r12, r7)
159 L(mi1): vmov d1, r10, r12
164 L(end): vsli.u64 d3, d1, #63
167 L(wd2): vmov r4, r5, d2
168 IFADD(` adc r1, n, #0')
169 IFSUB
(`
adc r1
, n
, #
1')
173 L(rtn): vmov.32 r0, d4[0]