Tizen 2.1 base
[external/gmp.git] / mpn / clipper / add_n.s
1 ; Clipper __gmpn_add_n -- Add two limb vectors of the same length > 0 and store
2 ; sum in a third limb vector.
3
4 ; Copyright 1995, 2000 Free Software Foundation, Inc.
5
6 ; This file is part of the GNU MP Library.
7
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 3 of the License, or (at your
11 ; option) any later version.
12
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.
17
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/.
20
21 .text
22         .align 16
23 .globl ___gmpn_add_n
24 ___gmpn_add_n:
25         subq    $8,sp
26         storw   r6,(sp)
27         loadw   12(sp),r2
28         loadw   16(sp),r3
29         loadq   $0,r6           ; clear carry-save register
30
31 .Loop:  loadw   (r1),r4
32         loadw   (r2),r5
33         addwc   r6,r6           ; restore carry from r6
34         addwc   r5,r4
35         storw   r4,(r0)
36         subwc   r6,r6           ; save carry in r6
37         addq    $4,r0
38         addq    $4,r1
39         addq    $4,r2
40         subq    $1,r3
41         brne    .Loop
42
43         negw    r6,r0
44         loadw   (sp),r6
45         addq    $8,sp
46         ret     sp