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 Library General Public License as published by
10 # the Free Software Foundation; either version 2 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 Library General Public
16 # License for more details.
18 # You should have received a copy of the GNU Library General Public License
19 # along with the GNU MP Library; see the file COPYING.LIB. If not, write to
20 # the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
38 or $
31,$
31,$
25 # clear cy
39 subq $
19,4,$
19 # decr loop cnt
40 blt $
19,.Lend2 # if less than 4 limbs, goto 2nd loop
41 # Start software pipeline for 1st loop
46 addq $
17,32,$
17 # update s1_ptr
48 addq $
0,$
4,$
20 # 1st main add
50 subq $
19,4,$
19 # decr loop cnt
52 cmpult $
20,$
0,$
25 # compute cy from last add
54 addq $
1,$
25,$
28 # cy add
55 addq $
18,32,$
18 # update s2_ptr
56 addq $
5,$
28,$
21 # 2nd main add
57 cmpult $
28,$
25,$
8 # compute cy from last add
58 blt $
19,.Lend1 # if less than 4 limbs remain, jump
59 # 1st loop handles groups of 4 limbs in a software pipeline
61 .Loop: cmpult $21,$28,$25 # compute cy from last add
63 or $
8,$
25,$
25 # combine cy from the two adds
65 addq $
2,$
25,$
28 # cy add
67 addq $
28,$
6,$
22 # 3rd main add
69 cmpult $
28,$
25,$
8 # compute cy from last add
70 cmpult $
22,$
28,$
25 # compute cy from last add
72 or $
8,$
25,$
25 # combine cy from the two adds
74 addq $
3,$
25,$
28 # cy add
75 addq $
28,$
7,$
23 # 4th main add
76 cmpult $
28,$
25,$
8 # compute cy from last add
77 cmpult $
23,$
28,$
25 # compute cy from last add
78 addq $
17,32,$
17 # update s1_ptr
79 or $
8,$
25,$
25 # combine cy from the two adds
80 addq $
16,32,$
16 # update res_ptr
81 addq $
0,$
25,$
28 # cy add
83 addq $
4,$
28,$
20 # 1st main add
85 cmpult $
28,$
25,$
8 # compute cy from last add
87 cmpult $
20,$
28,$
25 # compute cy from last add
89 or $
8,$
25,$
25 # combine cy from the two adds
90 subq $
19,4,$
19 # decr loop cnt
92 addq $
1,$
25,$
28 # cy add
94 addq $
5,$
28,$
21 # 2nd main add
95 addq $
18,32,$
18 # update s2_ptr
96 cmpult $
28,$
25,$
8 # compute cy from last add
98 # Finish software pipeline for 1st loop
99 .Lend1: cmpult $21,$28,$25 # compute cy from last add
100 or $
8,$
25,$
25 # combine cy from the two adds
101 addq $
2,$
25,$
28 # cy add
102 addq $
28,$
6,$
22 # 3rd main add
103 cmpult $
28,$
25,$
8 # compute cy from last add
104 cmpult $
22,$
28,$
25 # compute cy from last add
106 or $
8,$
25,$
25 # combine cy from the two adds
108 addq $
3,$
25,$
28 # cy add
109 addq $
28,$
7,$
23 # 4th main add
110 cmpult $
28,$
25,$
8 # compute cy from last add
111 cmpult $
23,$
28,$
25 # compute cy from last add
112 or $
8,$
25,$
25 # combine cy from the two adds
113 addq $
16,32,$
16 # update res_ptr
116 .Lend2: addq $19,4,$19 # restore loop cnt
118 # Start software pipeline for 2nd loop
123 # 2nd loop handles remaining 1-3 limbs
125 .Loop0: addq $0,$25,$28 # cy add
127 addq $
4,$
28,$
20 # main add
130 cmpult $
28,$
25,$
8 # compute cy from last add
133 cmpult $
20,$
28,$
25 # compute cy from last add
134 subq $
19,1,$
19 # decr loop cnt
135 or $
8,$
25,$
25 # combine cy from the two adds
138 .Lend0: addq $0,$25,$28 # cy add
139 addq $
4,$
28,$
20 # main add
140 cmpult $
28,$
25,$
8 # compute cy from last add
141 cmpult $
20,$
28,$
25 # compute cy from last add
143 or $
8,$
25,$
25 # combine cy from the two adds
145 .Lret: or $25,$31,$0 # return cy