Tizen 2.1 base
[external/gmp.git] / mpn / ns32k / add_n.s
1 # ns32000 __gmpn_add_n -- Add two limb vectors of the same length > 0 and store
2 # sum in a third limb vector.
3
4 # Copyright 1992, 1994, 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
22         .align 1
23 .globl ___gmpn_add_n
24 ___gmpn_add_n:
25         save    [r3,r4,r5]
26         negd    28(sp),r3
27         movd    r3,r0
28         lshd    2,r0
29         movd    24(sp),r4
30         subd    r0,r4                   # r4 -> to end of S2
31         movd    20(sp),r5
32         subd    r0,r5                   # r5 -> to end of S1
33         movd    16(sp),r2
34         subd    r0,r2                   # r2 -> to end of RES
35         subd    r0,r0                   # cy = 0
36
37 Loop:   movd    r5[r3:d],r0
38         addcd   r4[r3:d],r0
39         movd    r0,r2[r3:d]
40         acbd    1,r3,Loop
41
42         scsd    r0                      # r0 = cy.
43         restore [r5,r4,r3]
44         ret     0