1dnl  SH mpn_sub_n -- Subtract two limb vectors of the same length > 0 and store
2dnl  difference in a third limb vector.
3
4dnl  Copyright 1995, 1997, 2000, 2011 Free Software Foundation, Inc.
5
6dnl  This file is part of the GNU MP Library.
7dnl
8dnl  The GNU MP Library is free software; you can redistribute it and/or modify
9dnl  it under the terms of either:
10dnl
11dnl    * the GNU Lesser General Public License as published by the Free
12dnl      Software Foundation; either version 3 of the License, or (at your
13dnl      option) any later version.
14dnl
15dnl  or
16dnl
17dnl    * the GNU General Public License as published by the Free Software
18dnl      Foundation; either version 2 of the License, or (at your option) any
19dnl      later version.
20dnl
21dnl  or both in parallel, as here.
22dnl
23dnl  The GNU MP Library is distributed in the hope that it will be useful, but
24dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
25dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
26dnl  for more details.
27dnl
28dnl  You should have received copies of the GNU General Public License and the
29dnl  GNU Lesser General Public License along with the GNU MP Library.  If not,
30dnl  see https://www.gnu.org/licenses/.
31
32
33include(`../config.m4')
34
35C INPUT PARAMETERS
36C rp		r4
37C up		r5
38C vp		r6
39C n		r7
40
41changecom(blah)			C disable # to make all C comments below work
42
43ASM_START()
44PROLOGUE(mpn_sub_n)
45	mov	#0,r3		C clear cy save reg
46
47L(top):	mov.l	@r5+,r1
48	mov.l	@r6+,r2
49	shlr	r3		C restore cy
50	subc	r2,r1
51	movt	r3		C save cy
52	mov.l	r1,@r4
53	dt	r7
54	bf.s	L(top)
55	 add	#4,r4
56
57	rts
58	mov	r3,r0		C return carry-out from most significant limb
59EPILOGUE()
60