Gentoo Archives: gentoo-commits

From: "Mark Loeser (halcy0n)" <halcy0n@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] gentoo commit in src/patchsets/glibc/2.9: 6019_all_alpha-floor_ceil_fix.patch README.history
Date: Sat, 29 Aug 2009 14:31:55
Message-Id: E1MhTnC-0002tI-DB@stork.gentoo.org
1 halcy0n 09/08/29 19:40:54
2
3 Modified: README.history
4 Added: 6019_all_alpha-floor_ceil_fix.patch
5 Log:
6 Rolling new patchset with gcc-4.4 fix and alpha fix (bug #264335)
7
8 Revision Changes Path
9 1.16 src/patchsets/glibc/2.9/README.history
10
11 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.9/README.history?rev=1.16&view=markup
12 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.9/README.history?rev=1.16&content-type=text/plain
13 diff : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.9/README.history?r1=1.15&r2=1.16
14
15 Index: README.history
16 ===================================================================
17 RCS file: /var/cvsroot/gentoo/src/patchsets/glibc/2.9/README.history,v
18 retrieving revision 1.15
19 retrieving revision 1.16
20 diff -u -r1.15 -r1.16
21 --- README.history 5 Jul 2009 19:42:36 -0000 1.15
22 +++ README.history 29 Aug 2009 19:40:54 -0000 1.16
23 @@ -1,5 +1,6 @@
24 -6 [pending]
25 +6 28.08.2009
26 + 0045_all_glibc-2.10-gcc-4.4-nptl.patch
27 + + 6019_all_alpha-floor_ceil_fix.patch
28
29 5 31.03.2009
30 + 0085_all_glibc-disable-ldconfig.patch
31
32
33
34 1.1 src/patchsets/glibc/2.9/6019_all_alpha-floor_ceil_fix.patch
35
36 file : http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.9/6019_all_alpha-floor_ceil_fix.patch?rev=1.1&view=markup
37 plain: http://sources.gentoo.org/viewcvs.py/gentoo/src/patchsets/glibc/2.9/6019_all_alpha-floor_ceil_fix.patch?rev=1.1&content-type=text/plain
38
39 Index: 6019_all_alpha-floor_ceil_fix.patch
40 ===================================================================
41 diff -ur glibc-2.9-20081201.old/sysdeps/alpha/fpu/s_ceil.c glibc-2.9-20081201/sysdeps/alpha/fpu/s_ceil.c
42 --- glibc-2.9-20081201.old/sysdeps/alpha/fpu/s_ceil.c 2009-08-10 20:12:12.117316000 -0400
43 +++ glibc-2.9-20081201/sysdeps/alpha/fpu/s_ceil.c 2009-08-10 20:14:04.947138000 -0400
44 @@ -27,20 +27,25 @@
45 double
46 __ceil (double x)
47 {
48 - double two52 = copysign (0x1.0p52, x);
49 - double r, tmp;
50 -
51 - __asm (
52 + if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
53 + {
54 + double tmp1, new_x;
55 +
56 + new_x = -x;
57 + __asm (
58 #ifdef _IEEE_FP_INEXACT
59 - "addt/suim %2, %3, %1\n\tsubt/suim %1, %3, %0"
60 + "cvttq/svim %2,%1\n\t"
61 #else
62 - "addt/sum %2, %3, %1\n\tsubt/sum %1, %3, %0"
63 + "cvttq/svm %2,%1\n\t"
64 #endif
65 - : "=&f"(r), "=&f"(tmp)
66 - : "f"(-x), "f"(-two52));
67 + "cvtqt/m %1,%0\n\t"
68 + : "=f"(new_x), "=&f"(tmp1)
69 + : "f"(new_x));
70
71 - /* Fix up the negation we did above, as well as handling -0 properly. */
72 - return copysign (r, x);
73 + /* Fix up the negation we did above, as well as handling -0 properly. */
74 + x = copysign(new_x, x);
75 + }
76 + return x;
77 }
78
79 weak_alias (__ceil, ceil)
80 diff -ur glibc-2.9-20081201.old/sysdeps/alpha/fpu/s_ceilf.c glibc-2.9-20081201/sysdeps/alpha/fpu/s_ceilf.c
81 --- glibc-2.9-20081201.old/sysdeps/alpha/fpu/s_ceilf.c 2009-08-10 20:12:12.120247000 -0400
82 +++ glibc-2.9-20081201/sysdeps/alpha/fpu/s_ceilf.c 2009-08-10 20:14:04.948115000 -0400
83 @@ -26,20 +26,30 @@
84 float
85 __ceilf (float x)
86 {
87 - float two23 = copysignf (0x1.0p23, x);
88 - float r, tmp;
89 -
90 - __asm (
91 + if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
92 + {
93 + /* Note that Alpha S_Floating is stored in registers in a
94 + restricted T_Floating format, so we don't even need to
95 + convert back to S_Floating in the end. The initial
96 + conversion to T_Floating is needed to handle denormals. */
97 +
98 + float tmp1, tmp2, new_x;
99 +
100 + new_x = -x;
101 + __asm ("cvtst/s %3,%2\n\t"
102 #ifdef _IEEE_FP_INEXACT
103 - "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0"
104 + "cvttq/svim %2,%1\n\t"
105 #else
106 - "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0"
107 + "cvttq/svm %2,%1\n\t"
108 #endif
109 - : "=&f"(r), "=&f"(tmp)
110 - : "f"(-x), "f"(-two23));
111 + "cvtqt/m %1,%0\n\t"
112 + : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
113 + : "f"(new_x));
114
115 - /* Fix up the negation we did above, as well as handling -0 properly. */
116 - return copysignf (r, x);
117 + /* Fix up the negation we did above, as well as handling -0 properly. */
118 + x = copysignf(new_x, x);
119 + }
120 + return x;
121 }
122
123 weak_alias (__ceilf, ceilf)
124 diff -ur glibc-2.9-20081201.old/sysdeps/alpha/fpu/s_floor.c glibc-2.9-20081201/sysdeps/alpha/fpu/s_floor.c
125 --- glibc-2.9-20081201.old/sysdeps/alpha/fpu/s_floor.c 2009-08-10 20:12:12.119270000 -0400
126 +++ glibc-2.9-20081201/sysdeps/alpha/fpu/s_floor.c 2009-08-10 20:14:04.949092000 -0400
127 @@ -21,26 +21,32 @@
128 #include <math_ldbl_opt.h>
129
130
131 -/* Use the -inf rounding mode conversion instructions to implement floor. */
132 +/* Use the -inf rounding mode conversion instructions to implement
133 + floor. We note when the exponent is large enough that the value
134 + must be integral, as this avoids unpleasant integer overflows. */
135
136 double
137 __floor (double x)
138 {
139 - double two52 = copysign (0x1.0p52, x);
140 - double r, tmp;
141 -
142 - __asm (
143 + if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
144 + {
145 + double tmp1, new_x;
146 +
147 + __asm (
148 #ifdef _IEEE_FP_INEXACT
149 - "addt/suim %2, %3, %1\n\tsubt/suim %1, %3, %0"
150 + "cvttq/svim %2,%1\n\t"
151 #else
152 - "addt/sum %2, %3, %1\n\tsubt/sum %1, %3, %0"
153 + "cvttq/svm %2,%1\n\t"
154 #endif
155 - : "=&f"(r), "=&f"(tmp)
156 - : "f"(x), "f"(two52));
157 + "cvtqt/m %1,%0\n\t"
158 + : "=f"(new_x), "=&f"(tmp1)
159 + : "f"(x));
160
161 - /* floor(-0) == -0, and in general we'll always have the same
162 - sign as our input. */
163 - return copysign (r, x);
164 + /* floor(-0) == -0, and in general we'll always have the same
165 + sign as our input. */
166 + x = copysign(new_x, x);
167 + }
168 + return x;
169 }
170
171 weak_alias (__floor, floor)
172 diff -ur glibc-2.9-20081201.old/sysdeps/alpha/fpu/s_floorf.c glibc-2.9-20081201/sysdeps/alpha/fpu/s_floorf.c
173 --- glibc-2.9-20081201.old/sysdeps/alpha/fpu/s_floorf.c 2009-08-10 20:12:12.118293000 -0400
174 +++ glibc-2.9-20081201/sysdeps/alpha/fpu/s_floorf.c 2009-08-10 20:14:04.950069000 -0400
175 @@ -20,26 +20,37 @@
176 #include <math.h>
177
178
179 -/* Use the -inf rounding mode conversion instructions to implement floor. */
180 +/* Use the -inf rounding mode conversion instructions to implement
181 + floor. We note when the exponent is large enough that the value
182 + must be integral, as this avoids unpleasant integer overflows. */
183
184 float
185 __floorf (float x)
186 {
187 - float two23 = copysignf (0x1.0p23, x);
188 - float r, tmp;
189 -
190 - __asm (
191 + if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
192 + {
193 + /* Note that Alpha S_Floating is stored in registers in a
194 + restricted T_Floating format, so we don't even need to
195 + convert back to S_Floating in the end. The initial
196 + conversion to T_Floating is needed to handle denormals. */
197 +
198 + float tmp1, tmp2, new_x;
199 +
200 + __asm ("cvtst/s %3,%2\n\t"
201 #ifdef _IEEE_FP_INEXACT
202 - "adds/suim %2, %3, %1\n\tsubs/suim %1, %3, %0"
203 + "cvttq/svim %2,%1\n\t"
204 #else
205 - "adds/sum %2, %3, %1\n\tsubs/sum %1, %3, %0"
206 + "cvttq/svm %2,%1\n\t"
207 #endif
208 - : "=&f"(r), "=&f"(tmp)
209 - : "f"(x), "f"(two23));
210 + "cvtqt/m %1,%0\n\t"
211 + : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
212 + : "f"(x));
213
214 - /* floor(-0) == -0, and in general we'll always have the same
215 - sign as our input. */
216 - return copysignf (r, x);
217 + /* floor(-0) == -0, and in general we'll always have the same
218 + sign as our input. */
219 + x = copysignf(new_x, x);
220 + }
221 + return x;
222 }
223
224 weak_alias (__floorf, floorf)
225 diff -ur glibc-2.9-20081201.old/sysdeps/alpha/fpu/s_rint.c glibc-2.9-20081201/sysdeps/alpha/fpu/s_rint.c
226 --- glibc-2.9-20081201.old/sysdeps/alpha/fpu/s_rint.c 2009-08-10 20:12:12.119270000 -0400
227 +++ glibc-2.9-20081201/sysdeps/alpha/fpu/s_rint.c 2009-08-10 20:14:04.951046000 -0400
228 @@ -24,15 +24,24 @@
229 double
230 __rint (double x)
231 {
232 - double two52 = copysign (0x1.0p52, x);
233 - double r;
234 -
235 - r = x + two52;
236 - r = r - two52;
237 + if (isless (fabs (x), 9007199254740992.0)) /* 1 << DBL_MANT_DIG */
238 + {
239 + double tmp1, new_x;
240 + __asm (
241 +#ifdef _IEEE_FP_INEXACT
242 + "cvttq/svid %2,%1\n\t"
243 +#else
244 + "cvttq/svd %2,%1\n\t"
245 +#endif
246 + "cvtqt/d %1,%0\n\t"
247 + : "=f"(new_x), "=&f"(tmp1)
248 + : "f"(x));
249
250 - /* rint(-0.1) == -0, and in general we'll always have the same sign
251 - as our input. */
252 - return copysign (r, x);
253 + /* rint(-0.1) == -0, and in general we'll always have the same
254 + sign as our input. */
255 + x = copysign(new_x, x);
256 + }
257 + return x;
258 }
259
260 weak_alias (__rint, rint)
261 diff -ur glibc-2.9-20081201.old/sysdeps/alpha/fpu/s_rintf.c glibc-2.9-20081201/sysdeps/alpha/fpu/s_rintf.c
262 --- glibc-2.9-20081201.old/sysdeps/alpha/fpu/s_rintf.c 2009-08-10 20:12:12.116339000 -0400
263 +++ glibc-2.9-20081201/sysdeps/alpha/fpu/s_rintf.c 2009-08-10 20:14:04.952023000 -0400
264 @@ -23,15 +23,30 @@
265 float
266 __rintf (float x)
267 {
268 - float two23 = copysignf (0x1.0p23, x);
269 - float r;
270 + if (isless (fabsf (x), 16777216.0f)) /* 1 << FLT_MANT_DIG */
271 + {
272 + /* Note that Alpha S_Floating is stored in registers in a
273 + restricted T_Floating format, so we don't even need to
274 + convert back to S_Floating in the end. The initial
275 + conversion to T_Floating is needed to handle denormals. */
276
277 - r = x + two23;
278 - r = r - two23;
279 + float tmp1, tmp2, new_x;
280
281 - /* rint(-0.1) == -0, and in general we'll always have the same sign
282 - as our input. */
283 - return copysign (r, x);
284 + __asm ("cvtst/s %3,%2\n\t"
285 +#ifdef _IEEE_FP_INEXACT
286 + "cvttq/svid %2,%1\n\t"
287 +#else
288 + "cvttq/svd %2,%1\n\t"
289 +#endif
290 + "cvtqt/d %1,%0\n\t"
291 + : "=f"(new_x), "=&f"(tmp1), "=&f"(tmp2)
292 + : "f"(x));
293 +
294 + /* rint(-0.1) == -0, and in general we'll always have the same
295 + sign as our input. */
296 + x = copysignf(new_x, x);
297 + }
298 + return x;
299 }
300
301 weak_alias (__rintf, rintf)