1; mc88110 __gmpn_addmul_1 -- Multiply a limb vector with a single limb and
2; store the product in a second limb vector.
3
4; Copyright 1996, 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	r2
24; s1_ptr	r3
25; size		r4
26; s2_limb	r5
27
28	text
29	align	16
30	global	___gmpn_addmul_1
31___gmpn_addmul_1:
32	lda	 r3,r3[r4]
33	lda	 r8,r2[r4]		; RES_PTR in r8 since r2 is retval
34	subu	 r4,r0,r4
35	addu.co	 r2,r0,r0		; r2 = cy = 0
36
37	ld	 r6,r3[r4]
38	addu	 r4,r4,1
39	subu	 r8,r8,4
40	bcnd.n	 eq0,r4,Lend
41	 mulu.d	 r10,r6,r5
42
43Loop:	ld	 r7,r8[r4]
44	ld	 r6,r3[r4]
45	addu.cio r9,r11,r2
46	addu.ci	 r2,r10,r0
47	addu.co	 r9,r9,r7
48	st	 r9,r8[r4]
49	addu	 r4,r4,1
50	mulu.d	 r10,r6,r5
51	bcnd	 ne0,r4,Loop
52
53Lend:	ld	 r7,r8,0
54	addu.cio r9,r11,r2
55	addu.ci	 r2,r10,r0
56	addu.co	 r9,r9,r7
57	st	 r9,r8,0
58	jmp.n	 r1
59	 addu.ci r2,r2,r0
60