sub_n.asm revision 1.1.1.1
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.
7
8dnl  The GNU MP Library is free software; you can redistribute it and/or modify
9dnl  it under the terms of the GNU Lesser General Public License as published
10dnl  by the Free Software Foundation; either version 3 of the License, or (at
11dnl  your option) any later version.
12
13dnl  The GNU MP Library is distributed in the hope that it will be useful, but
14dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
16dnl  License for more details.
17
18dnl  You should have received a copy of the GNU Lesser General Public License
19dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
20
21
22include(`../config.m4')
23
24C INPUT PARAMETERS
25C rp		r4
26C up		r5
27C vp		r6
28C n		r7
29
30changecom(blah)			C disable # to make all C comments below work
31
32ASM_START()
33PROLOGUE(mpn_sub_n)
34	mov	#0,r3		C clear cy save reg
35
36L(top):	mov.l	@r5+,r1
37	mov.l	@r6+,r2
38	shlr	r3		C restore cy
39	subc	r2,r1
40	movt	r3		C save cy
41	mov.l	r1,@r4
42	dt	r7
43	bf.s	L(top)
44	 add	#4,r4
45
46	rts
47	mov	r3,r0		C return carry-out from most significant limb
48EPILOGUE()
49