1 dnl ARM mpn_addlshC_n
, mpn_sublshC_n
, mpn_rsblshC_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
/.
43 C
* Consider using
4-way feed
-in code.
44 C
* This is ad
-hoc scheduled
, perhaps unnecessarily so for A15
, and perhaps
45 C insufficiently for A7
and A8.
53 define(`ADCSBCS', `adcs
$1, $2, $3')
54 define(`CLRCY', `cmn r13
, #
1')
55 define(`RETVAL', `
adc r0
, $1, #
0')
56 define(`func', mpn_addlsh`
'LSH`'_n
)')
58 define
(`ADCSBCS
', `sbcs $1, $2, $3')
59 define
(`CLRCY
', `cmp r13, #0')
60 define
(`RETVAL
', `sbc $2, $2, $2
63 define
(`func
', mpn_sublsh`'LSH`
'_n)')
65 define(`ADCSBCS', `sbcs
$1, $3, $2')
66 define(`CLRCY', `
cmp r13
, #
0')
67 define(`RETVAL', `sbc r0
, $1, #
0')
68 define(`func', mpn_rsblsh`
'LSH`'_n
)')
74 vmov.i8 d0, #0 C could feed carry through here
79 L(bb1): vld1.32 {d3[0]}, [vp]!
83 vshr.u32 d0, d3, #32-LSH
84 ADCSBCS( r12, r12, r5)
92 L(b10): vld1.32 {d3}, [vp]!
96 vshr.u64 d0, d3, #64-LSH
97 ADCSBCS( r10, r10, r4)
98 ADCSBCS( r12, r12, r5)
103 L(b00): vld1.32 {d2}, [vp]!
104 vsli.u64 d0, d2, #LSH
105 vshr.u64 d1, d2, #64-LSH
107 vsli.u64 d1, d3, #LSH
109 vshr.u64 d0, d3, #64-LSH
115 L(top): ldmia up!, {r8,r9,r10,r12}
117 vsli.u64 d0, d2, #LSH
119 vshr.u64 d1, d2, #64-LSH
123 vsli.u64 d1, d3, #LSH
125 vshr.u64 d0, d3, #64-LSH
126 ADCSBCS( r10, r10, r4)
127 ADCSBCS( r12, r12, r5)
128 stmia rp!, {r8,r9,r10,r12}
133 L(end): ldmia up!, {r8,r9,r10,r12}
137 ADCSBCS( r10, r10, r4)
138 ADCSBCS( r12, r12, r5)
139 stmia rp!, {r8,r9,r10,r12}
140 L(rtn): vmov.32 r0, d0[0]