1 # Alpha __mpn_add_n -- Add two limb vectors of the same length > 0 and
2 # store sum in a third limb vector.
4 # Copyright (C) 1995 Free Software Foundation, Inc.
6 # This file is part of the GNU MP Library.
8 # The GNU MP Library is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU Lesser General Public License as published by
10 # the Free Software Foundation; either version 2.1 of the License, or (at your
11 # option) any later version.
13 # The GNU MP Library is distributed in the hope that it will be useful, but
14 # WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 # or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public
16 # License for more details.
18 # You should have received a copy of the GNU Lesser General Public License
19 # along with the GNU MP Library. If not, see <http://www.gnu.org/licenses/>.
37 or $
31,$
31,$
25 # clear cy
38 subq $
19,4,$
19 # decr loop cnt
39 blt $
19,.Lend2 # if less than 4 limbs, goto 2nd loop
40 # Start software pipeline for 1st loop
45 addq $
17,32,$
17 # update s1_ptr
47 addq $
0,$
4,$
20 # 1st main add
49 subq $
19,4,$
19 # decr loop cnt
51 cmpult $
20,$
0,$
25 # compute cy from last add
53 addq $
1,$
25,$
28 # cy add
54 addq $
18,32,$
18 # update s2_ptr
55 addq $
5,$
28,$
21 # 2nd main add
56 cmpult $
28,$
25,$
8 # compute cy from last add
57 blt $
19,.Lend1 # if less than 4 limbs remain, jump
58 # 1st loop handles groups of 4 limbs in a software pipeline
60 .Loop: cmpult $21,$28,$25 # compute cy from last add
62 or $
8,$
25,$
25 # combine cy from the two adds
64 addq $
2,$
25,$
28 # cy add
66 addq $
28,$
6,$
22 # 3rd main add
68 cmpult $
28,$
25,$
8 # compute cy from last add
69 cmpult $
22,$
28,$
25 # compute cy from last add
71 or $
8,$
25,$
25 # combine cy from the two adds
73 addq $
3,$
25,$
28 # cy add
74 addq $
28,$
7,$
23 # 4th main add
75 cmpult $
28,$
25,$
8 # compute cy from last add
76 cmpult $
23,$
28,$
25 # compute cy from last add
77 addq $
17,32,$
17 # update s1_ptr
78 or $
8,$
25,$
25 # combine cy from the two adds
79 addq $
16,32,$
16 # update res_ptr
80 addq $
0,$
25,$
28 # cy add
82 addq $
4,$
28,$
20 # 1st main add
84 cmpult $
28,$
25,$
8 # compute cy from last add
86 cmpult $
20,$
28,$
25 # compute cy from last add
88 or $
8,$
25,$
25 # combine cy from the two adds
89 subq $
19,4,$
19 # decr loop cnt
91 addq $
1,$
25,$
28 # cy add
93 addq $
5,$
28,$
21 # 2nd main add
94 addq $
18,32,$
18 # update s2_ptr
95 cmpult $
28,$
25,$
8 # compute cy from last add
97 # Finish software pipeline for 1st loop
98 .Lend1: cmpult $21,$28,$25 # compute cy from last add
99 or $
8,$
25,$
25 # combine cy from the two adds
100 addq $
2,$
25,$
28 # cy add
101 addq $
28,$
6,$
22 # 3rd main add
102 cmpult $
28,$
25,$
8 # compute cy from last add
103 cmpult $
22,$
28,$
25 # compute cy from last add
105 or $
8,$
25,$
25 # combine cy from the two adds
107 addq $
3,$
25,$
28 # cy add
108 addq $
28,$
7,$
23 # 4th main add
109 cmpult $
28,$
25,$
8 # compute cy from last add
110 cmpult $
23,$
28,$
25 # compute cy from last add
111 or $
8,$
25,$
25 # combine cy from the two adds
112 addq $
16,32,$
16 # update res_ptr
115 .Lend2: addq $19,4,$19 # restore loop cnt
117 # Start software pipeline for 2nd loop
122 # 2nd loop handles remaining 1-3 limbs
124 .Loop0: addq $0,$25,$28 # cy add
126 addq $
4,$
28,$
20 # main add
129 cmpult $
28,$
25,$
8 # compute cy from last add
132 cmpult $
20,$
28,$
25 # compute cy from last add
133 subq $
19,1,$
19 # decr loop cnt
134 or $
8,$
25,$
25 # combine cy from the two adds
137 .Lend0: addq $0,$25,$28 # cy add
138 addq $
4,$
28,$
20 # main add
139 cmpult $
28,$
25,$
8 # compute cy from last add
140 cmpult $
20,$
28,$
25 # compute cy from last add
142 or $
8,$
25,$
25 # combine cy from the two adds
144 .Lret: or $25,$31,$0 # return cy