1! Z8000 __gmpn_sub_n -- Subtract two limb vectors of the same length > 0 and
2! store difference in a third limb vector.
3
4! Copyright 1993, 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! INPUT PARAMETERS
23! res_ptr	r7
24! s1_ptr	r6
25! s2_ptr	r5
26! size		r4
27
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...
31
32	unseg
33	.text
34	even
35	global ___gmpn_sub_n
36___gmpn_sub_n:
37	pop	r0,@r6
38	pop	r1,@r5
39	sub	r0,r1
40	ld	@r7,r0
41	dec	r4
42	jr	eq,Lend
43Loop:	pop	r0,@r6
44	pop	r1,@r5
45	sbc	r0,r1
46	inc	r7,#2
47	ld	@r7,r0
48	dec	r4
49	jr	ne,Loop
50Lend:	ld	r2,r4		! use 0 already in r4
51	adc	r2,r2
52	ret	t
53