diff options
author | Siddhesh Poyarekar <siddhesh@redhat.com> | 2013-03-29 16:37:26 +0530 |
---|---|---|
committer | Siddhesh Poyarekar <siddhesh@redhat.com> | 2013-03-29 16:37:26 +0530 |
commit | a64d7e0efb34bde344bc1d4d17646a8ae6b6d588 (patch) | |
tree | 7b8fd9b40f7589d920cef1fabe6e80cf84af037f /sysdeps/ieee754 | |
parent | d26dd3eb006e813d5f81bd7a5f02d70d480de8c4 (diff) | |
download | glibc-a64d7e0efb34bde344bc1d4d17646a8ae6b6d588.tar glibc-a64d7e0efb34bde344bc1d4d17646a8ae6b6d588.tar.gz glibc-a64d7e0efb34bde344bc1d4d17646a8ae6b6d588.tar.bz2 glibc-a64d7e0efb34bde344bc1d4d17646a8ae6b6d588.zip |
Remove ZERO and MZERO macros
Diffstat (limited to 'sysdeps/ieee754')
-rw-r--r-- | sysdeps/ieee754/dbl-64/e_atan2.c | 38 | ||||
-rw-r--r-- | sysdeps/ieee754/dbl-64/e_log.c | 28 | ||||
-rw-r--r-- | sysdeps/ieee754/dbl-64/mpa.h | 6 | ||||
-rw-r--r-- | sysdeps/ieee754/dbl-64/mpatan2.c | 4 | ||||
-rw-r--r-- | sysdeps/ieee754/dbl-64/mpexp.c | 2 | ||||
-rw-r--r-- | sysdeps/ieee754/dbl-64/s_atan.c | 26 |
6 files changed, 51 insertions, 53 deletions
diff --git a/sysdeps/ieee754/dbl-64/e_atan2.c b/sysdeps/ieee754/dbl-64/e_atan2.c index bfe0b3b632..4ebe9c01f9 100644 --- a/sysdeps/ieee754/dbl-64/e_atan2.c +++ b/sysdeps/ieee754/dbl-64/e_atan2.c @@ -104,7 +104,7 @@ __ieee754_atan2 (double y, double x) if (dy == 0x00000000) { if ((ux & 0x80000000) == 0x00000000) - return ZERO; + return 0; else return opi.d; } @@ -114,14 +114,14 @@ __ieee754_atan2 (double y, double x) if (dy == 0x00000000) { if ((ux & 0x80000000) == 0x00000000) - return MZERO; + return -0.0; else return mopi.d; } } /* x=+-0 */ - if (x == ZERO) + if (x == 0) { if ((uy & 0x80000000) == 0x00000000) return hpi.d; @@ -147,9 +147,9 @@ __ieee754_atan2 (double y, double x) else { if ((uy & 0x80000000) == 0x00000000) - return ZERO; + return 0; else - return MZERO; + return -0.0; } } } @@ -190,16 +190,16 @@ __ieee754_atan2 (double y, double x) } /* either x/y or y/x is very close to zero */ - ax = (x < ZERO) ? -x : x; - ay = (y < ZERO) ? -y : y; + ax = (x < 0) ? -x : x; + ay = (y < 0) ? -y : y; de = (uy & 0x7ff00000) - (ux & 0x7ff00000); if (de >= ep) { - return ((y > ZERO) ? hpi.d : mhpi.d); + return ((y > 0) ? hpi.d : mhpi.d); } else if (de <= em) { - if (x > ZERO) + if (x > 0) { if ((z = ay / ax) < TWOM1022) return normalized (ax, ay, y, z); @@ -208,7 +208,7 @@ __ieee754_atan2 (double y, double x) } else { - return ((y > ZERO) ? opi.d : mopi.d); + return ((y > 0) ? opi.d : mopi.d); } } @@ -240,7 +240,7 @@ __ieee754_atan2 (double y, double x) du = ((ax - v) - vv) / ay; } - if (x > ZERO) + if (x > 0) { /* (i) x>0, abs(y)< abs(x): atan(ay/ax) */ if (ay < ax) @@ -262,7 +262,7 @@ __ieee754_atan2 (double y, double x) MUL2 (u, du, u, du, v, vv, t1, t2, t3, t4, t5, t6, t7, t8); s1 = v * (f11.d + v * (f13.d + v * (f15.d + v * (f17.d + v * f19.d)))); - ADD2 (f9.d, ff9.d, s1, ZERO, s2, ss2, t1, t2); + ADD2 (f9.d, ff9.d, s1, 0, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (f7.d, ff7.d, s1, ss1, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); @@ -314,7 +314,7 @@ __ieee754_atan2 (double y, double x) + v * (hij[i][13].d + v * (hij[i][14].d + v * hij[i][15].d)))); - ADD2 (hij[i][9].d, hij[i][10].d, s1, ZERO, s2, ss2, t1, t2); + ADD2 (hij[i][9].d, hij[i][10].d, s1, 0, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (hij[i][7].d, hij[i][8].d, s1, ss1, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); @@ -348,7 +348,7 @@ __ieee754_atan2 (double y, double x) s1 = v * (f11.d + v * (f13.d + v * (f15.d + v * (f17.d + v * f19.d)))); - ADD2 (f9.d, ff9.d, s1, ZERO, s2, ss2, t1, t2); + ADD2 (f9.d, ff9.d, s1, 0, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (f7.d, ff7.d, s1, ss1, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); @@ -391,7 +391,7 @@ __ieee754_atan2 (double y, double x) + v * (hij[i][14].d + v * hij[i][15].d)))); - ADD2 (hij[i][9].d, hij[i][10].d, s1, ZERO, s2, ss2, t1, t2); + ADD2 (hij[i][9].d, hij[i][10].d, s1, 0, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (hij[i][7].d, hij[i][8].d, s1, ss1, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); @@ -426,7 +426,7 @@ __ieee754_atan2 (double y, double x) MUL2 (u, du, u, du, v, vv, t1, t2, t3, t4, t5, t6, t7, t8); s1 = v * (f11.d + v * (f13.d + v * (f15.d + v * (f17.d + v * f19.d)))); - ADD2 (f9.d, ff9.d, s1, ZERO, s2, ss2, t1, t2); + ADD2 (f9.d, ff9.d, s1, 0, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (f7.d, ff7.d, s1, ss1, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); @@ -466,7 +466,7 @@ __ieee754_atan2 (double y, double x) + v * (hij[i][13].d + v * (hij[i][14].d + v * hij[i][15].d)))); - ADD2 (hij[i][9].d, hij[i][10].d, s1, ZERO, s2, ss2, t1, t2); + ADD2 (hij[i][9].d, hij[i][10].d, s1, 0, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (hij[i][7].d, hij[i][8].d, s1, ss1, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); @@ -497,7 +497,7 @@ __ieee754_atan2 (double y, double x) MUL2 (u, du, u, du, v, vv, t1, t2, t3, t4, t5, t6, t7, t8); s1 = v * (f11.d + v * (f13.d + v * (f15.d + v * (f17.d + v * f19.d)))); - ADD2 (f9.d, ff9.d, s1, ZERO, s2, ss2, t1, t2); + ADD2 (f9.d, ff9.d, s1, 0, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (f7.d, ff7.d, s1, ss1, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); @@ -538,7 +538,7 @@ __ieee754_atan2 (double y, double x) + v * (hij[i][13].d + v * (hij[i][14].d + v * hij[i][15].d)))); - ADD2 (hij[i][9].d, hij[i][10].d, s1, ZERO, s2, ss2, t1, t2); + ADD2 (hij[i][9].d, hij[i][10].d, s1, 0, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (hij[i][7].d, hij[i][8].d, s1, ss1, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); diff --git a/sysdeps/ieee754/dbl-64/e_log.c b/sysdeps/ieee754/dbl-64/e_log.c index d3b5e6ea82..f8d5a19ad0 100644 --- a/sysdeps/ieee754/dbl-64/e_log.c +++ b/sysdeps/ieee754/dbl-64/e_log.c @@ -79,9 +79,9 @@ __ieee754_log (double x) if (__builtin_expect (ux < 0x00100000, 0)) { if (__builtin_expect (((ux & 0x7fffffff) | dx) == 0, 0)) - return MHALF / ZERO; /* return -INF */ + return MHALF / 0.0; /* return -INF */ if (__builtin_expect (ux < 0, 0)) - return (x - x) / ZERO; /* return NaN */ + return (x - x) / 0.0; /* return NaN */ n -= 54; x *= two54.d; /* scale x */ num.d = x; @@ -130,25 +130,25 @@ __ieee754_log (double x) EMULV (w, a, s2, ss2, t1, t2, t3, t4, t5); ADD2 (d10.d, dd10.d, s2, ss2, s3, ss3, t1, t2); - MUL2 (w, ZERO, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); + MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (d9.d, dd9.d, s2, ss2, s3, ss3, t1, t2); - MUL2 (w, ZERO, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); + MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (d8.d, dd8.d, s2, ss2, s3, ss3, t1, t2); - MUL2 (w, ZERO, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); + MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (d7.d, dd7.d, s2, ss2, s3, ss3, t1, t2); - MUL2 (w, ZERO, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); + MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (d6.d, dd6.d, s2, ss2, s3, ss3, t1, t2); - MUL2 (w, ZERO, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); + MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (d5.d, dd5.d, s2, ss2, s3, ss3, t1, t2); - MUL2 (w, ZERO, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); + MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (d4.d, dd4.d, s2, ss2, s3, ss3, t1, t2); - MUL2 (w, ZERO, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); + MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (d3.d, dd3.d, s2, ss2, s3, ss3, t1, t2); - MUL2 (w, ZERO, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); + MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (d2.d, dd2.d, s2, ss2, s3, ss3, t1, t2); - MUL2 (w, ZERO, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); - MUL2 (w, ZERO, s2, ss2, s3, ss3, t1, t2, t3, t4, t5, t6, t7, t8); - ADD2 (w, ZERO, s3, ss3, b, bb, t1, t2); + MUL2 (w, 0, s3, ss3, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); + MUL2 (w, 0, s2, ss2, s3, ss3, t1, t2, t3, t4, t5, t6, t7, t8); + ADD2 (w, 0, s3, ss3, b, bb, t1, t2); /* End stage II, case abs(x-1) < 0.03 */ if ((y = b + (bb + b * E4)) == b + (bb - b * E4)) @@ -210,7 +210,7 @@ case_03: EADD (r0, t, ra, rb); /* Compute w */ - MUL2 (q, ZERO, ra, rb, w, ww, t1, t2, t3, t4, t5, t6, t7, t8); + MUL2 (q, 0, ra, rb, w, ww, t1, t2, t3, t4, t5, t6, t7, t8); EADD (A, B0, a0, aa0); diff --git a/sysdeps/ieee754/dbl-64/mpa.h b/sysdeps/ieee754/dbl-64/mpa.h index 54044a0586..27bc7dcb5d 100644 --- a/sysdeps/ieee754/dbl-64/mpa.h +++ b/sysdeps/ieee754/dbl-64/mpa.h @@ -91,8 +91,6 @@ extern const mp_no mptwo; # define TWO52 0x1.0p52 /* 2^52 */ #endif -#define ZERO 0.0 /* 0 */ -#define MZERO -0.0 /* 0 with the sign bit set */ #define ONE 1.0 /* 1 */ #define MONE -1.0 /* -1 */ #define TWO 2.0 /* 2 */ @@ -155,7 +153,7 @@ __pow_mp (int pow, mp_no *y, int p) Y[0] = ONE; Y[1] = 1 << rem; - /* Everything else is ZERO. */ + /* Everything else is 0. */ for (i = 2; i <= p; i++) - Y[i] = ZERO; + Y[i] = 0; } diff --git a/sysdeps/ieee754/dbl-64/mpatan2.c b/sysdeps/ieee754/dbl-64/mpatan2.c index d29c2fbade..f4aa9dbd06 100644 --- a/sysdeps/ieee754/dbl-64/mpatan2.c +++ b/sysdeps/ieee754/dbl-64/mpatan2.c @@ -46,11 +46,11 @@ __mpatan2 (mp_no *y, mp_no *x, mp_no *z, int p) { mp_no mpt1, mpt2, mpt3; - if (X[0] <= ZERO) + if (X[0] <= 0) { __dvd (x, y, &mpt1, p); __mul (&mpt1, &mpt1, &mpt2, p); - if (mpt1.d[0] != ZERO) + if (mpt1.d[0] != 0) mpt1.d[0] = ONE; __add (&mpt2, &mpone, &mpt3, p); __mpsqrt (&mpt3, &mpt2, p); diff --git a/sysdeps/ieee754/dbl-64/mpexp.c b/sysdeps/ieee754/dbl-64/mpexp.c index 565c6c8531..a219401228 100644 --- a/sysdeps/ieee754/dbl-64/mpexp.c +++ b/sysdeps/ieee754/dbl-64/mpexp.c @@ -85,7 +85,7 @@ __mpexp (mp_no *x, mp_no *y, int p) { for (i = 2; i <= p; i++) { - if (X[i] != ZERO) + if (X[i] != 0) break; } if (i == p + 1) diff --git a/sysdeps/ieee754/dbl-64/s_atan.c b/sysdeps/ieee754/dbl-64/s_atan.c index dc1716f93a..e3c4be775a 100644 --- a/sysdeps/ieee754/dbl-64/s_atan.c +++ b/sysdeps/ieee754/dbl-64/s_atan.c @@ -78,7 +78,7 @@ atan (double x) return x + x; /* Regular values of x, including denormals +-0 and +-INF */ - u = (x < ZERO) ? -x : x; + u = (x < 0) ? -x : x; if (u < C) { if (u < B) @@ -106,7 +106,7 @@ atan (double x) s1 = f11.d + v * s1; s1 *= v; - ADD2 (f9.d, ff9.d, s1, ZERO, s2, ss2, t1, t2); + ADD2 (f9.d, ff9.d, s1, 0, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (f7.d, ff7.d, s1, ss1, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); @@ -114,9 +114,9 @@ atan (double x) MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (f3.d, ff3.d, s1, ss1, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); - MUL2 (x, ZERO, s1, ss1, s2, ss2, t1, t2, t3, t4, t5, t6, t7, + MUL2 (x, 0, s1, ss1, s2, ss2, t1, t2, t3, t4, t5, t6, t7, t8); - ADD2 (x, ZERO, s2, ss2, s1, ss1, t1, t2); + ADD2 (x, 0, s2, ss2, s1, ss1, t1, t2); if ((y = s1 + (ss1 - U5 * s1)) == s1 + (ss1 + U5 * s1)) return y; @@ -160,14 +160,14 @@ atan (double x) s1 = hij[i][11].d + z * s1; s1 *= z; - ADD2 (hij[i][9].d, hij[i][10].d, s1, ZERO, s2, ss2, t1, t2); - MUL2 (z, ZERO, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); + ADD2 (hij[i][9].d, hij[i][10].d, s1, 0, s2, ss2, t1, t2); + MUL2 (z, 0, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (hij[i][7].d, hij[i][8].d, s1, ss1, s2, ss2, t1, t2); - MUL2 (z, ZERO, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); + MUL2 (z, 0, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (hij[i][5].d, hij[i][6].d, s1, ss1, s2, ss2, t1, t2); - MUL2 (z, ZERO, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); + MUL2 (z, 0, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (hij[i][3].d, hij[i][4].d, s1, ss1, s2, ss2, t1, t2); - MUL2 (z, ZERO, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); + MUL2 (z, 0, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (hij[i][1].d, hij[i][2].d, s1, ss1, s2, ss2, t1, t2); if ((y = s2 + (ss2 - U6 * s2)) == s2 + (ss2 + U6 * s2)) return __signArctan (x, y); @@ -200,7 +200,7 @@ atan (double x) if ((y = t1 + (yy - u3)) == t1 + (yy + u3)) return __signArctan (x, y); - DIV2 (ONE, ZERO, u, ZERO, w, ww, t1, t2, t3, t4, t5, t6, t7, t8, t9, + DIV2 (ONE, 0, u, 0, w, ww, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10); t1 = w - hij[i][0].d; EADD (t1, ww, z, zz); @@ -211,7 +211,7 @@ atan (double x) s1 = hij[i][11].d + z * s1; s1 *= z; - ADD2 (hij[i][9].d, hij[i][10].d, s1, ZERO, s2, ss2, t1, t2); + ADD2 (hij[i][9].d, hij[i][10].d, s1, 0, s2, ss2, t1, t2); MUL2 (z, zz, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (hij[i][7].d, hij[i][8].d, s1, ss1, s2, ss2, t1, t2); MUL2 (z, zz, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); @@ -247,7 +247,7 @@ atan (double x) if ((y = t3 + (yy - U4)) == t3 + (yy + U4)) return __signArctan (x, y); - DIV2 (ONE, ZERO, u, ZERO, w, ww, t1, t2, t3, t4, t5, t6, t7, t8, + DIV2 (ONE, 0, u, 0, w, ww, t1, t2, t3, t4, t5, t6, t7, t8, t9, t10); MUL2 (w, ww, w, ww, v, vv, t1, t2, t3, t4, t5, t6, t7, t8); @@ -257,7 +257,7 @@ atan (double x) s1 = f11.d + v * s1; s1 *= v; - ADD2 (f9.d, ff9.d, s1, ZERO, s2, ss2, t1, t2); + ADD2 (f9.d, ff9.d, s1, 0, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); ADD2 (f7.d, ff7.d, s1, ss1, s2, ss2, t1, t2); MUL2 (v, vv, s2, ss2, s1, ss1, t1, t2, t3, t4, t5, t6, t7, t8); |