~ubuntu-branches/ubuntu/utopic/eglibc/utopic

« back to all changes in this revision

Viewing changes to debian/patches/any/cvs-wordsize-64-fixes.diff

  • Committer: Package Import Robot
  • Author(s): Adam Conrad
  • Date: 2012-10-26 05:14:58 UTC
  • mfrom: (1.5.1) (4.4.22 experimental)
  • Revision ID: package-import@ubuntu.com-20121026051458-oryotr4i03ob5pab
Tags: 2.16-0ubuntu1
* Merge with unreleased 2.16 in Debian experimental, remaining changes:
  - Drop the Breaks line from libc6, which refers to a Debian transition
  - Remove the libc6 recommends on libc6-i686, which we don't build
  - Enable libc6{,-dev}-armel on armhf and libc6{-dev}-armhf on armel
  - Ship update-locale and validlocale in /usr/sbin in libc-bin
  - Don't build locales or locales-all in Ubuntu, we rely on langpacks
  - Heavily mangle the way we do service restarting on major upgrades
  - Use different MIN_KERNEL_SUPPORTED versions than Debian, due to
    buildd needs.  This should be universally bumped to 3.2.0 once all
    our buildds (including the PPA guests) are running precise kernels
  - Build i386 variants as -march=i686, build amd64 with -O3, and build
    ppc64 variants (both 64-bit and 32-bit) with -O3 -fno-tree-vectorize
  - Re-enable unsubmitted-ldconfig-cache-abi.diff and rebuild the cache
    on upgrades from previous versions that used a different constant
  - debian/patches/any/local-CVE-2012-3406.diff: switch to malloc when
    array grows too large to handle via alloca extension (CVE-2012-3406)
  - Build generic i386/i686 flavour with -mno-tls-direct-seg-refs
* Changes added/dropped with this merge while reducing our delta:
  - Stop building glibc docs from the eglibc source, and instead make
    the glibc-docs stub have a hard dependency on glibc-doc-reference
  - Remove outdated conflicts against ancient versions of ia32-libs
  - Drop the tzdata dependency from libc6, it's in required and minimal
  - Use gcc-4.7/g++-4.7 by default on all our supported architectures
  - Save our historical changelog as changelog.ubuntu in the source
  - Drop nscd's libaudit build-dep for now, as libaudit is in universe
  - Drop the unnecessary Breaks from libc6 to locales and locales-all
  - Ship xen's ld.so.conf.d snippet as /etc/ld.so.conf.d/libc6-xen.conf
* Disable hard failures on the test suite for the first upload to raring

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
2012-06-21  Joseph Myers  <joseph@codesourcery.com>
2
 
 
3
 
       [BZ #14273]
4
 
       * sysdeps/ieee754/dbl-64/wordsize-64/e_cosh.c (__ieee754_cosh):
5
 
       Clear sign bit of 64-bit integer value before comparing against
6
 
       overflow value.
7
 
 
8
 
2012-06-05  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
9
 
 
10
 
       * sysdeps/ieee754/ldbl-128ibm/e_fmodl.c: Fix for wrong ldbl128-ibm
11
 
       fmodl commit.
12
 
 
13
 
2012-06-04  Adhemerval Zanella  <azanella@linux.vnet.ibm.com>
14
 
 
15
 
       * sysdeps/ieee754/ldbl-128ibm/e_fmodl.c (__ieee754_fmodl): Fix
16
 
       subnormal exponent extraction and add some __builtin_expect.
17
 
       * sysdeps/ieee754/ldbl-128ibm/math_ldbl.h (ldbl_extract_mantissa):
18
 
       Fix for subnormal mantissa calculation.
19
 
 
20
 
2012-06-01  Joseph Myers  <joseph@codesourcery.com>
21
 
 
22
 
       [BZ #14048]
23
 
       * sysdeps/ieee754/dbl-64/wordsize-64/e_fmod.c (__ieee754_fmod):
24
 
       Use int64_t for variable i.
25
 
 
26
 
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/e_cosh.c b/sysdeps/ieee754/dbl-64/wordsize-64/e_cosh.c
27
 
index 41dc42c..b8aadab 100644
28
 
--- a/sysdeps/ieee754/dbl-64/wordsize-64/e_cosh.c
29
 
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/e_cosh.c
30
 
@@ -67,6 +67,7 @@ __ieee754_cosh (double x)
31
 
     /* |x| in [log(maxdouble), overflowthresold] */
32
 
        int64_t fix;
33
 
        EXTRACT_WORDS64(fix, x);
34
 
+       fix &= UINT64_C(0x7fffffffffffffff);
35
 
        if (fix <= UINT64_C(0x408633ce8fb9f87d)) {
36
 
            w = __ieee754_exp(half*fabs(x));
37
 
            t = half*w;
38
 
diff --git a/sysdeps/ieee754/dbl-64/wordsize-64/e_fmod.c b/sysdeps/ieee754/dbl-64/wordsize-64/e_fmod.c
39
 
index 0e20571..5158196 100644
40
 
--- a/sysdeps/ieee754/dbl-64/wordsize-64/e_fmod.c
41
 
+++ b/sysdeps/ieee754/dbl-64/wordsize-64/e_fmod.c
42
 
@@ -24,8 +24,8 @@ static const double one = 1.0, Zero[] = {0.0, -0.0,};
43
 
 double
44
 
 __ieee754_fmod (double x, double y)
45
 
 {
46
 
-       int32_t n,i,ix,iy;
47
 
-       int64_t hx,hy,hz,sx;
48
 
+       int32_t n,ix,iy;
49
 
+       int64_t hx,hy,hz,sx,i;
50
 
 
51
 
        EXTRACT_WORDS64(hx,x);
52
 
        EXTRACT_WORDS64(hy,y);
53
 
diff --git a/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c b/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
54
 
index 4ad59a0..033fde7 100644
55
 
--- a/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
56
 
+++ b/sysdeps/ieee754/ldbl-128ibm/e_fmodl.c
57
 
@@ -27,7 +27,7 @@ static const long double one = 1.0, Zero[] = {0.0, -0.0,};
58
 
 long double
59
 
 __ieee754_fmodl (long double x, long double y)
60
 
 {
61
 
-       int64_t n,hx,hy,hz,ix,iy,sx,i;
62
 
+       int64_t n,hx,hy,hz,ix,iy,sx, i;
63
 
        u_int64_t lx,ly,lz;
64
 
        int temp;
65
 
 
66
 
@@ -38,41 +38,42 @@ __ieee754_fmodl (long double x, long double y)
67
 
        hy &= 0x7fffffffffffffffLL;             /* |y| */
68
 
 
69
 
     /* purge off exception values */
70
 
-       if((hy|(ly&0x7fffffffffffffff))==0||(hx>=0x7ff0000000000000LL)|| /* y=0,or x not finite */
71
 
-         (hy>0x7ff0000000000000LL))    /* or y is NaN */
72
 
+       if(__builtin_expect((hy|(ly&0x7fffffffffffffff))==0 ||
73
 
+                           (hx>=0x7ff0000000000000LL)|| /* y=0,or x not finite */
74
 
+                           (hy>0x7ff0000000000000LL),0))       /* or y is NaN */
75
 
            return (x*y)/(x*y);
76
 
-       if(hx<=hy) {
77
 
+       if(__builtin_expect(hx<=hy,0)) {
78
 
            if((hx<hy)||(lx<ly)) return x;      /* |x|<|y| return x */
79
 
            if(lx==ly)
80
 
                return Zero[(u_int64_t)sx>>63]; /* |x|=|y| return x*0*/
81
 
        }
82
 
 
83
 
     /* determine ix = ilogb(x) */
84
 
-       if(hx<0x0010000000000000LL) {   /* subnormal x */
85
 
+       if(__builtin_expect(hx<0x0010000000000000LL,0)) {       /* subnormal x */
86
 
            if(hx==0) {
87
 
                for (ix = -1043, i=lx; i>0; i<<=1) ix -=1;
88
 
            } else {
89
 
-               for (ix = -1022, i=hx<<19; i>0; i<<=1) ix -=1;
90
 
+               for (ix = -1022, i=(hx<<11); i>0; i<<=1) ix -=1;
91
 
            }
92
 
        } else ix = (hx>>52)-0x3ff;
93
 
 
94
 
     /* determine iy = ilogb(y) */
95
 
-       if(hy<0x0010000000000000LL) {   /* subnormal y */
96
 
+       if(__builtin_expect(hy<0x0010000000000000LL,0)) {       /* subnormal y */
97
 
            if(hy==0) {
98
 
                for (iy = -1043, i=ly; i>0; i<<=1) iy -=1;
99
 
            } else {
100
 
-               for (iy = -1022, i=hy<<19; i>0; i<<=1) iy -=1;
101
 
+               for (iy = -1022, i=(hy<<11); i>0; i<<=1) iy -=1;
102
 
            }
103
 
        } else iy = (hy>>52)-0x3ff;
104
 
 
105
 
     /* Make the IBM extended format 105 bit mantissa look like the ieee854 112
106
 
-       bit mantissa so the following operatations will give the correct
107
 
+       bit mantissa so the following operations will give the correct
108
 
        result.  */
109
 
        ldbl_extract_mantissa(&hx, &lx, &temp, x);
110
 
        ldbl_extract_mantissa(&hy, &ly, &temp, y);
111
 
 
112
 
     /* set up {hx,lx}, {hy,ly} and align y to x */
113
 
-       if(ix >= -1022)
114
 
+       if(__builtin_expect(ix >= -1022, 1))
115
 
            hx = 0x0001000000000000LL|(0x0000ffffffffffffLL&hx);
116
 
        else {          /* subnormal x, shift x to normal */
117
 
            n = -1022-ix;
118
 
@@ -84,7 +85,7 @@ __ieee754_fmodl (long double x, long double y)
119
 
                lx = 0;
120
 
            }
121
 
        }
122
 
-       if(iy >= -1022)
123
 
+       if(__builtin_expect(iy >= -1022, 1))
124
 
            hy = 0x0001000000000000LL|(0x0000ffffffffffffLL&hy);
125
 
        else {          /* subnormal y, shift y to normal */
126
 
            n = -1022-iy;
127
 
@@ -118,7 +119,7 @@ __ieee754_fmodl (long double x, long double y)
128
 
            hx = hx+hx+(lx>>63); lx = lx+lx;
129
 
            iy -= 1;
130
 
        }
131
 
-       if(iy>= -1022) {        /* normalize output */
132
 
+       if(__builtin_expect(iy>= -1022,0)) {    /* normalize output */
133
 
            x = ldbl_insert_mantissa((sx>>63), iy, hx, lx);
134
 
        } else {                /* subnormal output */
135
 
            n = -1022 - iy;
136
 
diff --git a/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h b/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
137
 
index d055d65..be9ac71 100644
138
 
--- a/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
139
 
+++ b/sysdeps/ieee754/ldbl-128ibm/math_ldbl.h
140
 
@@ -6,20 +6,20 @@
141
 
 #include <ieee754.h>
142
 
   
143
 
 static inline void
144
 
-ldbl_extract_mantissa (int64_t *hi64, u_int64_t *lo64, int *exp, long double x)
145
 
+ldbl_extract_mantissa (int64_t *hi64, uint64_t *lo64, int *exp, long double x)
146
 
 {
147
 
   /* We have 105 bits of mantissa plus one implicit digit.  Since
148
 
      106 bits are representable we use the first implicit digit for
149
 
      the number before the decimal point and the second implicit bit
150
 
      as bit 53 of the mantissa.  */
151
 
-  unsigned long long hi, lo;
152
 
+  uint64_t hi, lo;
153
 
   int ediff;
154
 
   union ibm_extended_long_double eldbl;
155
 
   eldbl.d = x;
156
 
   *exp = eldbl.ieee.exponent - IBM_EXTENDED_LONG_DOUBLE_BIAS;
157
 
 
158
 
-  lo = ((long long)eldbl.ieee.mantissa2 << 32) | eldbl.ieee.mantissa3;
159
 
-  hi = ((long long)eldbl.ieee.mantissa0 << 32) | eldbl.ieee.mantissa1;
160
 
+  lo = ((int64_t)eldbl.ieee.mantissa2 << 32) | eldbl.ieee.mantissa3;
161
 
+  hi = ((int64_t)eldbl.ieee.mantissa0 << 32) | eldbl.ieee.mantissa1;
162
 
   /* If the lower double is not a denomal or zero then set the hidden
163
 
      53rd bit.  */
164
 
   if (eldbl.ieee.exponent2 > 0x001)
165
 
@@ -31,8 +31,8 @@ ldbl_extract_mantissa (int64_t *hi64, u_int64_t *lo64, int *exp, long double x)
166
 
       ediff = eldbl.ieee.exponent - eldbl.ieee.exponent2;
167
 
       if (ediff > 53)
168
 
        lo = lo >> (ediff-53);
169
 
+      hi |= (1ULL << 52);
170
 
     }
171
 
-  hi |= (1ULL << 52);
172
 
   
173
 
   if ((eldbl.ieee.negative != eldbl.ieee.negative2)
174
 
       && ((eldbl.ieee.exponent2 != 0) && (lo != 0LL)))