Skip to content

Commit

Permalink
Fix powl inaccuracy for ldbl-128ibm (bug 14914).
Browse files Browse the repository at this point in the history
  • Loading branch information
Joseph Myers committed Dec 4, 2012
1 parent a915e17 commit b3b099a
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
7 changes: 7 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
2012-12-04 Joseph Myers <joseph@codesourcery.com>

[BZ #14914]
* sysdeps/ieee754/ldbl-128ibm/e_powl.c (__ieee754_powl): Clear
whole low double instead of just low 47 bits when splitting values
into two parts.

2012-12-03 Allan McRae <allan@archlinux.org>

* manual/stdio.texi (Predefined Printf Handlers): Remove
Expand Down
2 changes: 1 addition & 1 deletion NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Version 2.17
14661, 14669, 14672, 14683, 14694, 14716, 14719, 14743, 14767, 14783,
14784, 14785, 14793, 14796, 14797, 14801, 14803, 14805, 14807, 14811,
14815, 14821, 14822, 14824, 14828, 14831, 14835, 14838, 14856, 14863,
14865, 14866, 14868, 14869, 14871, 14879, 14889, 14893.
14865, 14866, 14868, 14869, 14871, 14879, 14889, 14893, 14914.

* CVE-2011-4609 svc_run() produces high cpu usage when accept fails with
EMFILE has been fixed (Bugzilla #14889).
Expand Down
14 changes: 7 additions & 7 deletions sysdeps/ieee754/ldbl-128ibm/e_powl.c
Original file line number Diff line number Diff line change
Expand Up @@ -324,13 +324,13 @@ __ieee754_powl (long double x, long double y)

o.value = s_h;
o.parts32.w3 = 0;
o.parts32.w2 &= 0xffff8000;
o.parts32.w2 = 0;
s_h = o.value;
/* t_h=ax+bp[k] High */
t_h = ax + bp[k];
o.value = t_h;
o.parts32.w3 = 0;
o.parts32.w2 &= 0xffff8000;
o.parts32.w2 = 0;
t_h = o.value;
t_l = ax - (t_h - bp[k]);
s_l = v * ((u - s_h * t_h) - s_h * t_l);
Expand All @@ -344,7 +344,7 @@ __ieee754_powl (long double x, long double y)
t_h = 3.0 + s2 + r;
o.value = t_h;
o.parts32.w3 = 0;
o.parts32.w2 &= 0xffff8000;
o.parts32.w2 = 0;
t_h = o.value;
t_l = r - ((t_h - 3.0) - s2);
/* u+v = s*(1+...) */
Expand All @@ -354,7 +354,7 @@ __ieee754_powl (long double x, long double y)
p_h = u + v;
o.value = p_h;
o.parts32.w3 = 0;
o.parts32.w2 &= 0xffff8000;
o.parts32.w2 = 0;
p_h = o.value;
p_l = v - (p_h - u);
z_h = cp_h * p_h; /* cp_h+cp_l = 2/(3*log2) */
Expand All @@ -364,7 +364,7 @@ __ieee754_powl (long double x, long double y)
t1 = (((z_h + z_l) + dp_h[k]) + t);
o.value = t1;
o.parts32.w3 = 0;
o.parts32.w2 &= 0xffff8000;
o.parts32.w2 = 0;
t1 = o.value;
t2 = z_l - (((t1 - t) - dp_h[k]) - z_h);

Expand All @@ -377,7 +377,7 @@ __ieee754_powl (long double x, long double y)
y1 = y;
o.value = y1;
o.parts32.w3 = 0;
o.parts32.w2 &= 0xffff8000;
o.parts32.w2 = 0;
y1 = o.value;
p_l = (y - y1) * t1 + y * t2;
p_h = y1 * t1;
Expand Down Expand Up @@ -421,7 +421,7 @@ __ieee754_powl (long double x, long double y)
t = p_l + p_h;
o.value = t;
o.parts32.w3 = 0;
o.parts32.w2 &= 0xffff8000;
o.parts32.w2 = 0;
t = o.value;
u = t * lg2_h;
v = (p_l - (t - p_h)) * lg2 + t * lg2_l;
Expand Down

0 comments on commit b3b099a

Please sign in to comment.