1 dnl Alpha ev6 nails mpn_add_n
and mpn_sub_n.
3 dnl Copyright
2002, 2006 Free Software Foundation
, Inc.
5 dnl
This file is part of the GNU MP Library.
7 dnl The GNU MP Library is free software
; you can redistribute it and/or modify
8 dnl it under the terms of
either:
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.
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
20 dnl
or both
in parallel
, as here.
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
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
/.
32 dnl Runs at
2.5 cycles
/limb. It would be possible to reach
2.0 cycles
/limb
33 dnl with
8-way unrolling.
35 include(`..
/config.m4
')
58 define(`numb_mask',`r21
')
60 define(`NAIL_BITS',`GMP_NAIL_BITS
')
61 define(`CYSH',`GMP_NUMB_BITS
')
63 dnl This declaration is munged by configure
66 ifdef(`OPERATION_add_n', `
68 define(`CYSH',`GMP_NUMB_BITS
')
69 define(`func', mpn_add_n
)')
70 ifdef(`OPERATION_sub_n', `
73 define
(`func
', mpn_sub_n)')
75 MULFUNC_PROLOGUE
(mpn_add_n mpn_sub_n
)
79 lda numb_mask
, -1(r31
)
80 srl numb_mask
, NAIL_BITS
, numb_mask
87 L
(lp0
): ldq ul0
, 0(up
)
95 and rl0
, numb_mask
, r28
102 L
(ge4
): ldq ul0
, 0(up
)
115 OP ul0
, vl0
, rl0 C main
-add 0
116 OP rl0
, r20
, rl0 C cy
-add 0
117 OP ul1
, vl1
, rl1 C main
-add 1
118 srl rl0
, CYSH
, r20 C gen cy
0
119 OP rl1
, r20
, rl1 C cy
-add 1
120 and rl0
,numb_mask
, r27
123 L
(ge8
): OP ul0
, vl0
, rl0 C main
-add 0
126 OP rl0
, r20
, rl0 C cy
-add 0
127 OP ul1
, vl1
, rl1 C main
-add 1
128 srl rl0
, CYSH
, r20 C gen cy
0
131 OP rl1
, r20
, rl1 C cy
-add 1
132 and rl0
,numb_mask
, r27
133 OP ul2
, vl2
, rl2 C main
-add 2
134 srl rl1
, CYSH
, r20 C gen cy
1
137 OP rl2
, r20
, rl2 C cy
-add 2
138 and rl1
,numb_mask
, r28
140 OP ul3
, vl3
, rl3 C main
-add 3
141 srl rl2
, CYSH
, r20 C gen cy
2
144 OP rl3
, r20
, rl3 C cy
-add 3
145 and rl2
,numb_mask
, r27
154 L
(top
): OP ul0
, vl0
, rl0 C main
-add 0
155 srl rl3
, CYSH
, r20 C gen cy
3
159 OP rl0
, r20
, rl0 C cy
-add 0
160 and rl3
,numb_mask
, r28
164 OP ul1
, vl1
, rl1 C main
-add 1
165 srl rl0
, CYSH
, r20 C gen cy
0
169 OP rl1
, r20
, rl1 C cy
-add 1
170 and rl0
,numb_mask
, r27
174 OP ul2
, vl2
, rl2 C main
-add 2
175 srl rl1
, CYSH
, r20 C gen cy
1
179 OP rl2
, r20
, rl2 C cy
-add 2
180 and rl1
,numb_mask
, r28
184 OP ul3
, vl3
, rl3 C main
-add 3
185 srl rl2
, CYSH
, r20 C gen cy
2
189 OP rl3
, r20
, rl3 C cy
-add 3
190 and rl2
,numb_mask
, r27
204 L
(end): OP ul0
, vl0
, rl0 C main
-add 0
205 srl rl3
, CYSH
, r20 C gen cy
3
206 OP rl0
, r20
, rl0 C cy
-add 0
207 and rl3
,numb_mask
, r28
209 OP ul1
, vl1
, rl1 C main
-add 1
210 srl rl0
, CYSH
, r20 C gen cy
0
211 OP rl1
, r20
, rl1 C cy
-add 1
212 and rl0
,numb_mask
, r27
214 L
(cj0
): OP ul2
, vl2
, rl2 C main
-add 2
215 srl rl1
, CYSH
, r20 C gen cy
1
216 OP rl2
, r20
, rl2 C cy
-add 2
217 and rl1
,numb_mask
, r28
219 OP ul3
, vl3
, rl3 C main
-add 3
220 srl rl2
, CYSH
, r20 C gen cy
2
221 OP rl3
, r20
, rl3 C cy
-add 3
222 and rl2
,numb_mask
, r27
225 srl rl3
, CYSH
, r20 C gen cy
3
226 and rl3
,numb_mask
, r28
230 L
(ret): and r20
, 1, r0