Mon Mar 18 22:54:32 1996 Andreas Schwab <schwab@issan.informatik.uni-dortmund.de>
[glibc.git] / sysdeps / z8000 / add_n.s
blob21efaf57145998f64696323721b9069dfee45e49
1 ! Z8000 __mpn_add_n -- Add two limb vectors of equal, non-zero length.
3 ! Copyright (C) 1993, 1994 Free Software Foundation, Inc.
5 ! This file is part of the GNU MP Library.
7 ! The GNU MP Library is free software; you can redistribute it and/or modify
8 ! it under the terms of the GNU Library General Public License as published by
9 ! the Free Software Foundation; either version 2 of the License, or (at your
10 ! option) any later version.
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 Library General Public
15 ! License for more details.
17 ! You should have received a copy of the GNU Library 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., 675 Mass Ave, Cambridge, MA 02139, USA.
22 ! INPUT PARAMETERS
23 ! res_ptr r7
24 ! s1_ptr r6
25 ! s2_ptr r5
26 ! size r4
28 ! If we are really crazy, we can use push to write a few result words
29 ! backwards, using push just because it is faster than reg+disp. We'd
30 ! then add 2x the number of words written to r7...
32 unseg
33 .text
34 even
35 global ___mpn_add_n
36 ___mpn_add_n:
37 pop r0,@r6
38 pop r1,@r5
39 add r0,r1
40 ld @r7,r0
41 dec r4
42 jr eq,Lend
43 Loop: pop r0,@r6
44 pop r1,@r5
45 adc r0,r1
46 inc r7,#2
47 ld @r7,r0
48 dec r4
49 jr ne,Loop
50 Lend: ld r2,r4 ! use 0 already in r4
51 adc r2,r2
52 ret t