FIX BUILD (with GHC 6.2.x): System.Directory.Internals is no more
[ghc-hetmet.git] / rts / gmp / mpn / z8000 / add_n.s
1 ! Z8000 __gmpn_add_n -- Add two limb vectors of equal, non-zero length.
2
3 ! Copyright (C) 1993, 1994, 2000 Free Software Foundation, Inc.
4
5 ! This file is part of the GNU MP Library.
6
7 ! The GNU MP Library is free software; you can redistribute it and/or modify
8 ! it under the terms of the GNU Lesser General Public License as published by
9 ! the Free Software Foundation; either version 2.1 of the License, or (at your
10 ! option) any later version.
11
12 ! The GNU MP Library is distributed in the hope that it will be useful, but
13 ! WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14 ! or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
15 ! License for more details.
16
17 ! You should have received a copy of the GNU Lesser General Public License
18 ! along with the GNU MP Library; see the file COPYING.LIB.  If not, write to
19 ! the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston,
20 ! MA 02111-1307, USA.
21
22
23 ! INPUT PARAMETERS
24 ! res_ptr       r7
25 ! s1_ptr        r6
26 ! s2_ptr        r5
27 ! size          r4
28
29 ! If we are really crazy, we can use push to write a few result words
30 ! backwards, using push just because it is faster than reg+disp.  We'd
31 ! then add 2x the number of words written to r7...
32
33         unseg
34         .text
35         even
36         global ___gmpn_add_n
37 ___gmpn_add_n:
38         pop     r0,@r6
39         pop     r1,@r5
40         add     r0,r1
41         ld      @r7,r0
42         dec     r4
43         jr      eq,Lend
44 Loop:   pop     r0,@r6
45         pop     r1,@r5
46         adc     r0,r1
47         inc     r7,#2
48         ld      @r7,r0
49         dec     r4
50         jr      ne,Loop
51 Lend:   ld      r2,r4           ! use 0 already in r4
52         adc     r2,r2
53         ret     t