1 dnl ARM mpn_add_n
and mpn_sub_n
3 dnl Contributed to the GNU project by Robert Harley.
5 dnl Copyright
1997, 2000, 2001, 2012 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
')
40 C Cortex-A9 2.5 slightly fluctuating
48 ifdef(`OPERATION_add_n', `
49 define
(`ADDSUB
', adds)
50 define(`ADDSUBC', adcs
)
51 define
(`CLRCY
', `cmn r0, #0')
52 define
(`SETCY
', `cmp $1, #1')
53 define
(`RETVAL
', `adc r0, n, #0')
54 define
(`func
', mpn_add_n)
55 define(`func_nc', mpn_add_nc
)')
56 ifdef(`OPERATION_sub_n', `
57 define
(`ADDSUB
', subs)
58 define(`ADDSUBC', sbcs
)
59 define
(`CLRCY
', `cmp r0, r0')
60 define
(`SETCY
', `rsbs $1, $1, #0')
61 define
(`RETVAL
', `sbc r0, r0, r0
63 define
(`func
', mpn_sub_n)
64 define(`func_nc', mpn_sub_nc
)')
66 MULFUNC_PROLOGUE(mpn_add_n mpn_add_nc mpn_sub_n mpn_sub_nc)
71 stmfd sp!, { r8, r9, lr }
76 stmfd sp!, { r8, r9, lr }
88 ldmia vp!, { r12, lr }
95 stmfd sp!, { r4, r5, r6, r7 }
97 L(top): ldmia up!, { r4, r5, r6, r7 }
98 ldmia vp!, { r8, r9, r12, lr }
104 stmia rp!, { r4, r5, r6, r7 }
108 ldmfd sp!, { r4, r5, r6, r7 }
111 ldmfd sp!, { r8, r9, pc }