138032Speterdnl  VAX mpn_submul_1 -- Multiply a limb vector with a limb and subtract the
2157006Sgshapirodnl  result from a second limb vector.
364565Sgshapiro
438032Speterdnl  Copyright 1992, 1994, 1996, 2000, 2012 Free Software Foundation, Inc.
538032Speter
638032Speterdnl  This file is part of the GNU MP Library.
738032Speterdnl
838032Speterdnl  The GNU MP Library is free software; you can redistribute it and/or modify
938032Speterdnl  it under the terms of either:
1038032Speterdnl
1138032Speterdnl    * the GNU Lesser General Public License as published by the Free
12120259Sgshapirodnl      Software Foundation; either version 3 of the License, or (at your
1338032Speterdnl      option) any later version.
1438032Speterdnl
1590795Sgshapirodnl  or
1638032Speterdnl
17159613Sgshapirodnl    * the GNU General Public License as published by the Free Software
1864565Sgshapirodnl      Foundation; either version 2 of the License, or (at your option) any
19132946Sgshapirodnl      later version.
20111826Sgshapirodnl
2164565Sgshapirodnl  or both in parallel, as here.
22157006Sgshapirodnl
2364565Sgshapirodnl  The GNU MP Library is distributed in the hope that it will be useful, but
2438032Speterdnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
2538032Speterdnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
2638032Speterdnl  for more details.
2738032Speterdnl
2838032Speterdnl  You should have received copies of the GNU General Public License and the
2938032Speterdnl  GNU Lesser General Public License along with the GNU MP Library.  If not,
3038032Speterdnl  see https://www.gnu.org/licenses/.
3138032Speter
3238032Speterinclude(`../config.m4')
3338032Speter
3438032SpeterASM_START()
3538032SpeterPROLOGUE(mpn_submul_1)
3638032Speter	.word	0xfc0
3738032Speter	movl	12(ap), r4
3838032Speter	movl	8(ap), r8
3938032Speter	movl	4(ap), r9
4038032Speter	clrl	r3
4138032Speter	incl	r4
4238032Speter	ashl	$-1, r4, r7
4338032Speter	clrl	r11
4438032Speter	movl	16(ap), r6
4538032Speter	jlss	L(v0_big)
4638032Speter	jlbc	r4, L(1)
4790795Sgshapiro
4838032SpeterC Loop for v0 < 0x80000000
4938032SpeterL(tp1):	movl	(r8)+, r1
5064565Sgshapiro	jlss	L(1n0)
5138032Speter	emul	r1, r6, $0, r2
5238032Speter	addl2	r11, r2
5338032Speter	adwc	$0, r3
5466497Sgshapiro	subl2	r2, (r9)+
5538032Speter	adwc	$0, r3
5638032SpeterL(1):	movl	(r8)+, r1
5738032Speter	jlss	L(1n1)
5838032SpeterL(1p1):	emul	r1, r6, $0, r10
5938032Speter	addl2	r3, r10
6038032Speter	adwc	$0, r11
6138032Speter	subl2	r10, (r9)+
6238032Speter	adwc	$0, r11
6338032Speter
6438032Speter	sobgtr	r7, L(tp1)
6538032Speter	movl	r11, r0
6664565Sgshapiro	ret
6738032Speter
6890795SgshapiroL(1n0):	emul	r1, r6, $0, r2
6964565Sgshapiro	addl2	r11, r2
7038032Speter	adwc	r6, r3
7164565Sgshapiro	subl2	r2, (r9)+
7238032Speter	adwc	$0, r3
7338032Speter	movl	(r8)+, r1
7438032Speter	jgeq	L(1p1)
7590795SgshapiroL(1n1):	emul	r1, r6, $0, r10
7638032Speter	addl2	r3, r10
7738032Speter	adwc	r6, r11
7838032Speter	subl2	r10, (r9)+
7938032Speter	adwc	$0, r11
8038032Speter
8190795Sgshapiro	sobgtr	r7, L(tp1)
8264565Sgshapiro	movl	r11, r0
8338032Speter	ret
8438032Speter
8538032SpeterL(v0_big):
8690795Sgshapiro	jlbc	r4, L(2)
8764565Sgshapiro
8838032SpeterC Loop for v0 >= 0x80000000
8938032SpeterL(tp2):	movl	(r8)+, r1
9038032Speter	jlss	L(2n0)
9190795Sgshapiro	emul	r1, r6, $0, r2
92132946Sgshapiro	addl2	r11, r2
9390795Sgshapiro	adwc	r1, r3
9438032Speter	subl2	r2, (r9)+
9538032Speter	adwc	$0, r3
9638032SpeterL(2):	movl	(r8)+, r1
9738032Speter	jlss	L(2n1)
9838032SpeterL(2p1):	emul	r1, r6, $0, r10
9938032Speter	addl2	r3, r10
10038032Speter	adwc	r1, r11
10138032Speter	subl2	r10, (r9)+
10238032Speter	adwc	$0, r11
10364565Sgshapiro
10438032Speter	sobgtr	r7, L(tp2)
10564565Sgshapiro	movl	r11, r0
10664565Sgshapiro	ret
10764565Sgshapiro
10864565SgshapiroL(2n0):	emul	r1, r6, $0, r2
10964565Sgshapiro	addl2	r11, r2
11064565Sgshapiro	adwc	r6, r3
11164565Sgshapiro	subl2	r2, (r9)+
11264565Sgshapiro	adwc	r1, r3
11364565Sgshapiro	movl	(r8)+, r1
11464565Sgshapiro	jgeq	L(2p1)
11564565SgshapiroL(2n1):	emul	r1, r6, $0, r10
11664565Sgshapiro	addl2	r3, r10
11738032Speter	adwc	r6, r11
11864565Sgshapiro	subl2	r10, (r9)+
11964565Sgshapiro	adwc	r1, r11
12064565Sgshapiro
12164565Sgshapiro	sobgtr	r7, L(tp2)
12264565Sgshapiro	movl	r11, r0
12364565Sgshapiro	ret
12464565SgshapiroEPILOGUE()
12590795Sgshapiro