aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/udiv.S
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/udiv.S')
-rw-r--r--[-rwxr-xr-x]linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/udiv.S390
1 files changed, 195 insertions, 195 deletions
diff --git a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/udiv.S b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/udiv.S
index c4cd053..006b5c1 100755..100644
--- a/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/udiv.S
+++ b/linden/indra/libgcrypt/libgcrypt-1.2.2/mpi/sparc32/udiv.S
@@ -1,195 +1,195 @@
1/* SPARC v7 __udiv_qrnnd division support, used from longlong.h. 1/* SPARC v7 __udiv_qrnnd division support, used from longlong.h.
2 * This is for v7 CPUs without a floating-point unit. 2 * This is for v7 CPUs without a floating-point unit.
3 * 3 *
4 * Copyright (C) 1993, 1994, 1996, 1998, 4 * Copyright (C) 1993, 1994, 1996, 1998,
5 * 2001, 2002 Free Software Foundation, Inc. 5 * 2001, 2002 Free Software Foundation, Inc.
6 * 6 *
7 * This file is part of Libgcrypt. 7 * This file is part of Libgcrypt.
8 * 8 *
9 * Libgcrypt is free software; you can redistribute it and/or modify 9 * Libgcrypt is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU Lesser General Public License as 10 * it under the terms of the GNU Lesser General Public License as
11 * published by the Free Software Foundation; either version 2.1 of 11 * published by the Free Software Foundation; either version 2.1 of
12 * the License, or (at your option) any later version. 12 * the License, or (at your option) any later version.
13 * 13 *
14 * Libgcrypt is distributed in the hope that it will be useful, 14 * Libgcrypt is distributed in the hope that it will be useful,
15 * but WITHOUT ANY WARRANTY; without even the implied warranty of 15 * but WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 * GNU Lesser General Public License for more details. 17 * GNU Lesser General Public License for more details.
18 * 18 *
19 * You should have received a copy of the GNU Lesser General Public 19 * You should have received a copy of the GNU Lesser General Public
20 * License along with this program; if not, write to the Free Software 20 * License along with this program; if not, write to the Free Software
21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA 21 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
22 * 22 *
23 * Note: This code is heavily based on the GNU MP Library. 23 * Note: This code is heavily based on the GNU MP Library.
24 * Actually it's the same code with only minor changes in the 24 * Actually it's the same code with only minor changes in the
25 * way the data is stored; this is to support the abstraction 25 * way the data is stored; this is to support the abstraction
26 * of an optional secure memory allocation which may be used 26 * of an optional secure memory allocation which may be used
27 * to avoid revealing of sensitive data due to paging etc. 27 * to avoid revealing of sensitive data due to paging etc.
28 */ 28 */
29 29
30 30
31! INPUT PARAMETERS 31! INPUT PARAMETERS
32! rem_ptr o0 32! rem_ptr o0
33! n1 o1 33! n1 o1
34! n0 o2 34! n0 o2
35! d o3 35! d o3
36 36
37#include "sysdep.h" 37#include "sysdep.h"
38 38
39 .text 39 .text
40 .align 4 40 .align 4
41 .global C_SYMBOL_NAME(__udiv_qrnnd) 41 .global C_SYMBOL_NAME(__udiv_qrnnd)
42C_SYMBOL_NAME(__udiv_qrnnd): 42C_SYMBOL_NAME(__udiv_qrnnd):
43 tst %o3 43 tst %o3
44 bneg Largedivisor 44 bneg Largedivisor
45 mov 8,%g1 45 mov 8,%g1
46 46
47 b Lp1 47 b Lp1
48 addxcc %o2,%o2,%o2 48 addxcc %o2,%o2,%o2
49 49
50Lplop: bcc Ln1 50Lplop: bcc Ln1
51 addxcc %o2,%o2,%o2 51 addxcc %o2,%o2,%o2
52Lp1: addx %o1,%o1,%o1 52Lp1: addx %o1,%o1,%o1
53 subcc %o1,%o3,%o4 53 subcc %o1,%o3,%o4
54 bcc Ln2 54 bcc Ln2
55 addxcc %o2,%o2,%o2 55 addxcc %o2,%o2,%o2
56Lp2: addx %o1,%o1,%o1 56Lp2: addx %o1,%o1,%o1
57 subcc %o1,%o3,%o4 57 subcc %o1,%o3,%o4
58 bcc Ln3 58 bcc Ln3
59 addxcc %o2,%o2,%o2 59 addxcc %o2,%o2,%o2
60Lp3: addx %o1,%o1,%o1 60Lp3: addx %o1,%o1,%o1
61 subcc %o1,%o3,%o4 61 subcc %o1,%o3,%o4
62 bcc Ln4 62 bcc Ln4
63 addxcc %o2,%o2,%o2 63 addxcc %o2,%o2,%o2
64Lp4: addx %o1,%o1,%o1 64Lp4: addx %o1,%o1,%o1
65 addcc %g1,-1,%g1 65 addcc %g1,-1,%g1
66 bne Lplop 66 bne Lplop
67 subcc %o1,%o3,%o4 67 subcc %o1,%o3,%o4
68 bcc Ln5 68 bcc Ln5
69 addxcc %o2,%o2,%o2 69 addxcc %o2,%o2,%o2
70Lp5: st %o1,[%o0] 70Lp5: st %o1,[%o0]
71 retl 71 retl
72 xnor %g0,%o2,%o0 72 xnor %g0,%o2,%o0
73 73
74Lnlop: bcc Lp1 74Lnlop: bcc Lp1
75 addxcc %o2,%o2,%o2 75 addxcc %o2,%o2,%o2
76Ln1: addx %o4,%o4,%o4 76Ln1: addx %o4,%o4,%o4
77 subcc %o4,%o3,%o1 77 subcc %o4,%o3,%o1
78 bcc Lp2 78 bcc Lp2
79 addxcc %o2,%o2,%o2 79 addxcc %o2,%o2,%o2
80Ln2: addx %o4,%o4,%o4 80Ln2: addx %o4,%o4,%o4
81 subcc %o4,%o3,%o1 81 subcc %o4,%o3,%o1
82 bcc Lp3 82 bcc Lp3
83 addxcc %o2,%o2,%o2 83 addxcc %o2,%o2,%o2
84Ln3: addx %o4,%o4,%o4 84Ln3: addx %o4,%o4,%o4
85 subcc %o4,%o3,%o1 85 subcc %o4,%o3,%o1
86 bcc Lp4 86 bcc Lp4
87 addxcc %o2,%o2,%o2 87 addxcc %o2,%o2,%o2
88Ln4: addx %o4,%o4,%o4 88Ln4: addx %o4,%o4,%o4
89 addcc %g1,-1,%g1 89 addcc %g1,-1,%g1
90 bne Lnlop 90 bne Lnlop
91 subcc %o4,%o3,%o1 91 subcc %o4,%o3,%o1
92 bcc Lp5 92 bcc Lp5
93 addxcc %o2,%o2,%o2 93 addxcc %o2,%o2,%o2
94Ln5: st %o4,[%o0] 94Ln5: st %o4,[%o0]
95 retl 95 retl
96 xnor %g0,%o2,%o0 96 xnor %g0,%o2,%o0
97 97
98Largedivisor: 98Largedivisor:
99 and %o2,1,%o5 ! %o5 = n0 & 1 99 and %o2,1,%o5 ! %o5 = n0 & 1
100 100
101 srl %o2,1,%o2 101 srl %o2,1,%o2
102 sll %o1,31,%g2 102 sll %o1,31,%g2
103 or %g2,%o2,%o2 ! %o2 = lo(n1n0 >> 1) 103 or %g2,%o2,%o2 ! %o2 = lo(n1n0 >> 1)
104 srl %o1,1,%o1 ! %o1 = hi(n1n0 >> 1) 104 srl %o1,1,%o1 ! %o1 = hi(n1n0 >> 1)
105 105
106 and %o3,1,%g2 106 and %o3,1,%g2
107 srl %o3,1,%g3 ! %g3 = floor(d / 2) 107 srl %o3,1,%g3 ! %g3 = floor(d / 2)
108 add %g3,%g2,%g3 ! %g3 = ceil(d / 2) 108 add %g3,%g2,%g3 ! %g3 = ceil(d / 2)
109 109
110 b LLp1 110 b LLp1
111 addxcc %o2,%o2,%o2 111 addxcc %o2,%o2,%o2
112 112
113LLplop: bcc LLn1 113LLplop: bcc LLn1
114 addxcc %o2,%o2,%o2 114 addxcc %o2,%o2,%o2
115LLp1: addx %o1,%o1,%o1 115LLp1: addx %o1,%o1,%o1
116 subcc %o1,%g3,%o4 116 subcc %o1,%g3,%o4
117 bcc LLn2 117 bcc LLn2
118 addxcc %o2,%o2,%o2 118 addxcc %o2,%o2,%o2
119LLp2: addx %o1,%o1,%o1 119LLp2: addx %o1,%o1,%o1
120 subcc %o1,%g3,%o4 120 subcc %o1,%g3,%o4
121 bcc LLn3 121 bcc LLn3
122 addxcc %o2,%o2,%o2 122 addxcc %o2,%o2,%o2
123LLp3: addx %o1,%o1,%o1 123LLp3: addx %o1,%o1,%o1
124 subcc %o1,%g3,%o4 124 subcc %o1,%g3,%o4
125 bcc LLn4 125 bcc LLn4
126 addxcc %o2,%o2,%o2 126 addxcc %o2,%o2,%o2
127LLp4: addx %o1,%o1,%o1 127LLp4: addx %o1,%o1,%o1
128 addcc %g1,-1,%g1 128 addcc %g1,-1,%g1
129 bne LLplop 129 bne LLplop
130 subcc %o1,%g3,%o4 130 subcc %o1,%g3,%o4
131 bcc LLn5 131 bcc LLn5
132 addxcc %o2,%o2,%o2 132 addxcc %o2,%o2,%o2
133LLp5: add %o1,%o1,%o1 ! << 1 133LLp5: add %o1,%o1,%o1 ! << 1
134 tst %g2 134 tst %g2
135 bne Oddp 135 bne Oddp
136 add %o5,%o1,%o1 136 add %o5,%o1,%o1
137 st %o1,[%o0] 137 st %o1,[%o0]
138 retl 138 retl
139 xnor %g0,%o2,%o0 139 xnor %g0,%o2,%o0
140 140
141LLnlop: bcc LLp1 141LLnlop: bcc LLp1
142 addxcc %o2,%o2,%o2 142 addxcc %o2,%o2,%o2
143LLn1: addx %o4,%o4,%o4 143LLn1: addx %o4,%o4,%o4
144 subcc %o4,%g3,%o1 144 subcc %o4,%g3,%o1
145 bcc LLp2 145 bcc LLp2
146 addxcc %o2,%o2,%o2 146 addxcc %o2,%o2,%o2
147LLn2: addx %o4,%o4,%o4 147LLn2: addx %o4,%o4,%o4
148 subcc %o4,%g3,%o1 148 subcc %o4,%g3,%o1
149 bcc LLp3 149 bcc LLp3
150 addxcc %o2,%o2,%o2 150 addxcc %o2,%o2,%o2
151LLn3: addx %o4,%o4,%o4 151LLn3: addx %o4,%o4,%o4
152 subcc %o4,%g3,%o1 152 subcc %o4,%g3,%o1
153 bcc LLp4 153 bcc LLp4
154 addxcc %o2,%o2,%o2 154 addxcc %o2,%o2,%o2
155LLn4: addx %o4,%o4,%o4 155LLn4: addx %o4,%o4,%o4
156 addcc %g1,-1,%g1 156 addcc %g1,-1,%g1
157 bne LLnlop 157 bne LLnlop
158 subcc %o4,%g3,%o1 158 subcc %o4,%g3,%o1
159 bcc LLp5 159 bcc LLp5
160 addxcc %o2,%o2,%o2 160 addxcc %o2,%o2,%o2
161LLn5: add %o4,%o4,%o4 ! << 1 161LLn5: add %o4,%o4,%o4 ! << 1
162 tst %g2 162 tst %g2
163 bne Oddn 163 bne Oddn
164 add %o5,%o4,%o4 164 add %o5,%o4,%o4
165 st %o4,[%o0] 165 st %o4,[%o0]
166 retl 166 retl
167 xnor %g0,%o2,%o0 167 xnor %g0,%o2,%o0
168 168
169Oddp: xnor %g0,%o2,%o2 169Oddp: xnor %g0,%o2,%o2
170 ! q' in %o2. r' in %o1 170 ! q' in %o2. r' in %o1
171 addcc %o1,%o2,%o1 171 addcc %o1,%o2,%o1
172 bcc LLp6 172 bcc LLp6
173 addx %o2,0,%o2 173 addx %o2,0,%o2
174 sub %o1,%o3,%o1 174 sub %o1,%o3,%o1
175LLp6: subcc %o1,%o3,%g0 175LLp6: subcc %o1,%o3,%g0
176 bcs LLp7 176 bcs LLp7
177 subx %o2,-1,%o2 177 subx %o2,-1,%o2
178 sub %o1,%o3,%o1 178 sub %o1,%o3,%o1
179LLp7: st %o1,[%o0] 179LLp7: st %o1,[%o0]
180 retl 180 retl
181 mov %o2,%o0 181 mov %o2,%o0
182 182
183Oddn: xnor %g0,%o2,%o2 183Oddn: xnor %g0,%o2,%o2
184 ! q' in %o2. r' in %o4 184 ! q' in %o2. r' in %o4
185 addcc %o4,%o2,%o4 185 addcc %o4,%o2,%o4
186 bcc LLn6 186 bcc LLn6
187 addx %o2,0,%o2 187 addx %o2,0,%o2
188 sub %o4,%o3,%o4 188 sub %o4,%o3,%o4
189LLn6: subcc %o4,%o3,%g0 189LLn6: subcc %o4,%o3,%g0
190 bcs LLn7 190 bcs LLn7
191 subx %o2,-1,%o2 191 subx %o2,-1,%o2
192 sub %o4,%o3,%o4 192 sub %o4,%o3,%o4
193LLn7: st %o4,[%o0] 193LLn7: st %o4,[%o0]
194 retl 194 retl
195 mov %o2,%o0 195 mov %o2,%o0