beta-0.89.2
[luatex.git] / source / libs / gmp / gmp-src / mpn / s390_64 / mod_34lsub1.asm
blobfd40011a8c7ce5b1688f1d15a4d9fde6a9cae00b
1 dnl S/390-64 mpn_mod_34lsub1
3 dnl Copyright 2011 Free Software Foundation, Inc.
5 dnl This file is part of the GNU MP Library.
6 dnl
7 dnl The GNU MP Library is free software; you can redistribute it and/or modify
8 dnl it under the terms of either:
9 dnl
10 dnl * the GNU Lesser General Public License as published by the Free
11 dnl Software Foundation; either version 3 of the License, or (at your
12 dnl option) any later version.
13 dnl
14 dnl or
15 dnl
16 dnl * the GNU General Public License as published by the Free Software
17 dnl Foundation; either version 2 of the License, or (at your option) any
18 dnl later version.
19 dnl
20 dnl or both in parallel, as here.
21 dnl
22 dnl The GNU MP Library is distributed in the hope that it will be useful, but
23 dnl WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
24 dnl or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
25 dnl for more details.
26 dnl
27 dnl You should have received copies of the GNU General Public License and the
28 dnl GNU Lesser General Public License along with the GNU MP Library. If not,
29 dnl see https://www.gnu.org/licenses/.
31 include(`../config.m4')
33 C cycles/limb
34 C z900 5.8
35 C z990 2
36 C z9 ?
37 C z10 4.5
38 C z196 ?
40 C TODO
41 C * Optimise summation code, see x86_64.
43 C INPUT PARAMETERS
44 define(`rp', `%r2')
45 define(`n', `%r3')
47 ASM_START()
48 PROLOGUE(mpn_mod_34lsub1)
49 stmg %r7, %r12, 56(%r15)
50 lghi %r11, 0
51 lghi %r12, 0
52 lghi %r0, 0
53 lghi %r8, 0
54 lghi %r9, 0
55 lghi %r10, 0
56 lghi %r7, 0
57 aghi %r3, -3
58 jl .L3
60 L(top): alg %r0, 0(%r2)
61 alcg %r12, 8(%r2)
62 alcg %r11, 16(%r2)
63 alcgr %r8, %r7
64 la %r2, 24(%r2)
65 aghi %r3, -3
66 jnl L(top)
68 lgr %r7, %r8
69 srlg %r1, %r11, 16
70 nihh %r7, 0 C 0xffffffffffff
71 agr %r7, %r1
72 srlg %r8, %r8, 48
73 agr %r7, %r8
74 sllg %r11, %r11, 32
75 nihh %r11, 0
76 agr %r7, %r11
77 .L3:
78 cghi %r3, -3
79 je .L6
80 alg %r0, 0(%r2)
81 alcgr %r10, %r10
82 cghi %r3, -2
83 je .L6
84 alg %r12, 8(%r2)
85 alcgr %r9, %r9
86 .L6:
87 srlg %r1, %r0, 48
88 nihh %r0, 0 C 0xffffffffffff
89 agr %r0, %r1
90 agr %r0, %r7
91 srlg %r1, %r12, 32
92 agr %r0, %r1
93 srlg %r1, %r10, 32
94 agr %r0, %r1
95 llgfr %r12, %r12
96 srlg %r1, %r9, 16
97 sllg %r12, %r12, 16
98 llgfr %r10, %r10
99 agr %r0, %r1
100 llill %r2, 65535
101 agr %r0, %r12
102 sllg %r10, %r10, 16
103 ngr %r2, %r9
104 agr %r0, %r10
105 sllg %r2, %r2, 32
106 agr %r2, %r0
107 lmg %r7, %r12, 56(%r15)
108 br %r14
109 EPILOGUE()