xref: /netbsd-src/external/lgpl3/gmp/dist/mpn/s390_32/esame/addmul_1.asm (revision 501cd18a74d52bfcca7d9e7e3b0d472bbc870558)
1dnl  S/390-32 mpn_addmul_1 for systems with MLR instruction
2
3dnl  Copyright 2011 Free Software Foundation, Inc.
4
5dnl  This file is part of the GNU MP Library.
6
7dnl  The GNU MP Library is free software; you can redistribute it and/or modify
8dnl  it under the terms of the GNU Lesser General Public License as published
9dnl  by the Free Software Foundation; either version 3 of the License, or (at
10dnl  your option) any later version.
11
12dnl  The GNU MP Library is distributed in the hope that it will be useful, but
13dnl  WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
14dnl  or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU Lesser General Public
15dnl  License for more details.
16
17dnl  You should have received a copy of the GNU Lesser General Public License
18dnl  along with the GNU MP Library.  If not, see http://www.gnu.org/licenses/.
19
20include(`../config.m4')
21
22C            cycles/limb
23C z900		18.5
24C z990		10
25C z9		 ?
26C z10		 ?
27C z196		 ?
28
29C INPUT PARAMETERS
30define(`rp',	`%r2')
31define(`up',	`%r3')
32define(`n',	`%r4')
33define(`v0',	`%r5')
34
35define(`z',	`%r9')
36
37ASM_START()
38PROLOGUE(mpn_addmul_1)
39	stm	%r9, %r12, 36(%r15)
40	lhi	%r12, 0			C zero index reister
41	ahi	%r12, 0			C clear carry fla
42	lhi	%r11, 0			C clear carry limb
43	lhi	z, 0			C clear carry limb
44
45L(top):	l	%r1, 0(%r12,up)
46	l	%r10, 0(%r12,rp)
47	mlr	%r0, v0
48	alcr	%r1, %r10
49	alcr	%r0, z
50	alr	%r1, %r11
51	lr	%r11, %r0
52	st	%r1, 0(%r12,rp)
53	la	%r12, 4(%r12)
54	brct	n, L(top)
55
56	lhi	%r2, 0
57	alcr	%r2, %r11
58
59	lm	%r9, %r12, 36(%r15)
60	br	%r14
61EPILOGUE()
62