From 16f0ecedb5726fa46fac6a73b633aabcf469962d Mon Sep 17 00:00:00 2001 From: Roland McGrath Date: Tue, 31 Jan 2006 18:56:42 +0000 Subject: * sysdeps/ieee754/ldbl-128ibm/k_cosl.c (__kernel_cosl): Correct index for __sincosl_table. * sysdeps/ieee754/ldbl-128ibm/k_sincosl.c (__kernel_sincosl): Likewise. * sysdeps/ieee754/ldbl-128ibm/k_sinl.c (__kernel_sinl): Likewise. * sysdeps/ieee754/ldbl-128ibm/s_ceill.c: Correct sign of 0.0. * sysdeps/ieee754/ldbl-128ibm/s_floorl.c: Likewise. * sysdeps/ieee754/ldbl-128ibm/s_cprojl.c: New file. * sysdeps/ieee754/ldbl-128ibm/s_ctanhl.c: New file. * sysdeps/ieee754/ldbl-128ibm/s_ctanl.c: New file. --- sysdeps/ieee754/ldbl-128ibm/s_ceill.c | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'sysdeps/ieee754/ldbl-128ibm/s_ceill.c') diff --git a/sysdeps/ieee754/ldbl-128ibm/s_ceill.c b/sysdeps/ieee754/ldbl-128ibm/s_ceill.c index a4cbbe1..a606548 100644 --- a/sysdeps/ieee754/ldbl-128ibm/s_ceill.c +++ b/sysdeps/ieee754/ldbl-128ibm/s_ceill.c @@ -18,9 +18,6 @@ Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA. */ -/* This has been coded in assembler because GCC makes such a mess of it - when it's coded in C. */ - #include #include #include @@ -44,19 +41,23 @@ __ceill (x) u.d = x; if (fabs (u.dd[0]) < TWO52) - { + { + double high = u.dd[0]; fesetround(FE_UPWARD); - if (u.dd[0] > 0.0) + if (high > 0.0) { - u.dd[0] += TWO52; - u.dd[0] -= TWO52; + high += TWO52; + high -= TWO52; + if (high == -0.0) high = 0.0; } - else if (u.dd[0] < 0.0) + else if (high < 0.0) { - u.dd[0] -= TWO52; - u.dd[0] += TWO52; + high -= TWO52; + high += TWO52; + if (high == 0.0) high = -0.0; } - u.dd[1] = 0.0; + u.dd[0] = high; + u.dd[1] = 0.0; fesetround(mode); } else if (fabs (u.dd[1]) < TWO52 && u.dd[1] != 0.0) @@ -82,10 +83,10 @@ __ceill (x) adjust for that. */ high = nextafter (u.dd[0], 0.0); low = u.dd[1] + (u.dd[0] - high); - } + } fesetround(FE_UPWARD); low += TWO52; - low -= TWO52; + low -= TWO52; fesetround(mode); } else if (u.dd[0] < 0.0) @@ -103,10 +104,10 @@ __ceill (x) adjust for that. */ high = nextafter (u.dd[0], 0.0); low = u.dd[1] + (u.dd[0] - high); - } + } fesetround(FE_UPWARD); low -= TWO52; - low += TWO52; + low += TWO52; fesetround(mode); } u.dd[0] = high + low; -- cgit v1.1