xref: /netbsd-src/external/lgpl3/gmp/dist/mpn/s390_64/addmul_1.asm (revision 212397c69a103ae7e5eafa8731ddfae671d2dee7)
1dnl  S/390-64 mpn_addmul_1
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		34
24C z990		23
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	stmg	%r9, %r12, 72(%r15)
40	lghi	%r12, 0			C zero index register
41	aghi	%r12, 0			C clear carry flag
42	lghi	%r11, 0			C clear carry limb
43	lghi	z, 0			C keep register zero
44
45L(top):	lg	%r1, 0(%r12,up)
46	lg	%r10, 0(%r12,rp)
47	mlgr	%r0, v0
48	alcgr	%r1, %r10
49	alcgr	%r0, z
50	algr	%r1, %r11
51	lgr	%r11, %r0
52	stg	%r1, 0(%r12,rp)
53	la	%r12, 8(%r12)
54	brctg	n, L(top)
55
56	lghi	%r2, 0
57	alcgr	%r2, %r11
58
59	lmg	%r9, %r12, 72(%r15)
60	br	%r14
61EPILOGUE()
62