mod_34lsub1.asm revision 1.1.1.1
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		 5.8
24C z990           2
25C z9		 ?
26C z10		 ?
27C z196		 ?
28
29C TODO
30C  * Optimise summation code, see x86_64.
31
32C INPUT PARAMETERS
33define(`rp',	`%r2')
34define(`n',	`%r3')
35
36ASM_START()
37PROLOGUE(mpn_mod_34lsub1)
38	stmg	%r7, %r12, 56(%r15)
39	lghi	%r11, 0
40	lghi	%r12, 0
41	lghi	%r0, 0
42	lghi	%r8, 0
43	lghi	%r9, 0
44	lghi	%r10, 0
45	lghi	%r7, 0
46	aghi	%r3, -3
47	jl	.L3
48
49L(top):	alg	%r0, 0(%r2)
50	alcg	%r12, 8(%r2)
51	alcg	%r11, 16(%r2)
52	alcgr	%r8, %r7
53	la	%r2, 24(%r2)
54	aghi	%r3, -3
55	jnl	L(top)
56
57	lgr	%r7, %r8
58	srlg	%r1, %r11, 16
59	nihh	%r7, 0			C 0xffffffffffff
60	agr	%r7, %r1
61	srlg	%r8, %r8, 48
62	agr	%r7, %r8
63	sllg	%r11, %r11, 32
64	nihh	%r11, 0
65	agr	%r7, %r11
66.L3:
67	cghi	%r3, -3
68	je	.L6
69	alg	%r0, 0(%r2)
70	alcgr	%r10, %r10
71	cghi	%r3, -2
72	je	.L6
73	alg	%r12, 8(%r2)
74	alcgr	%r9, %r9
75.L6:
76	srlg	%r1, %r0, 48
77	nihh	%r0, 0			C 0xffffffffffff
78	agr	%r0, %r1
79	agr	%r0, %r7
80	srlg	%r1, %r12, 32
81	agr	%r0, %r1
82	srlg	%r1, %r10, 32
83	agr	%r0, %r1
84	llgfr	%r12, %r12
85	srlg	%r1, %r9, 16
86	sllg	%r12, %r12, 16
87	llgfr	%r10, %r10
88	agr	%r0, %r1
89	llill	%r2, 65535
90	agr	%r0, %r12
91	sllg	%r10, %r10, 16
92	ngr	%r2, %r9
93	agr	%r0, %r10
94	sllg	%r2, %r2, 32
95	agr	%r2, %r0
96	lmg	%r7, %r12, 56(%r15)
97	br	%r14
98EPILOGUE()
99