summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2013-01-10 14:53:40 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2013-01-10 14:59:18 +0530
commit751b85f795da302bca360388c3314bbbe1cc0bc0 (patch)
tree0306cdbbcfed28abcd19b8f02581ac56d92f9b18
parent7e9b080575fd68c788c33623594ba5516fa7ceb0 (diff)
downloadglibc-751b85f795da302bca360388c3314bbbe1cc0bc0.tar.gz
Make __mpexp_twomm1 an array of doubles
Cleanup to get rid of the `number` muck which is not necessary here.
-rw-r--r--ChangeLog7
-rw-r--r--sysdeps/ieee754/dbl-64/mpexp.c29
-rw-r--r--sysdeps/ieee754/dbl-64/mpexp.h84
3 files changed, 33 insertions, 87 deletions
diff --git a/ChangeLog b/ChangeLog
index ec80b446b1..5cd7df0103 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2013-01-10 Siddhesh Poyarekar <siddhesh@redhat.com>
+
+ * sysdeps/ieee754/dbl-64/mpexp.c (__mpexp): New array of
+ doubles __mpexp_twomm1. Adjust usage.
+ * sysdeps/ieee754/dbl-64/mpexp.h (__mpexp_twomm1):
+ Remove.
+
2013-01-10 Andreas Schwab <schwab@suse.de>
[BZ #14964]
diff --git a/sysdeps/ieee754/dbl-64/mpexp.c b/sysdeps/ieee754/dbl-64/mpexp.c
index c4048207ed..ac41ecf66c 100644
--- a/sysdeps/ieee754/dbl-64/mpexp.c
+++ b/sysdeps/ieee754/dbl-64/mpexp.c
@@ -47,8 +47,31 @@ __mpexp(mp_no *x, mp_no *y, int p) {
double a,b;
static const int np[33] = {0,0,0,0,3,3,4,4,5,4,4,5,5,5,6,6,6,6,6,6,
6,6,6,6,7,7,7,7,8,8,8,8,8};
- static const int m1p[33]= {0,0,0,0,17,23,23,28,27,38,42,39,43,47,43,47,50,54,
- 57,60,64,67,71,74,68,71,74,77,70,73,76,78,81};
+ static const int m1p[33]=
+ {
+ 0, 0, 0, 0,
+ 17, 23, 23, 28,
+ 27, 38, 42, 39,
+ 43, 47, 43, 47,
+ 50, 54, 57, 60,
+ 64, 67, 71, 74,
+ 68, 71, 74, 77,
+ 70, 73, 76, 78,
+ 81
+ };
+ /* Stored values for 2^-m, where values of m are defined in M1P above. */
+ static const double __mpexp_twomm1[33] =
+ {
+ 0x1.0p0, 0x1.0p0, 0x1.0p0, 0x1.0p0,
+ 0x1.0p-17, 0x1.0p-23, 0x1.0p-23, 0x1.0p-28,
+ 0x1.0p-27, 0x1.0p-38, 0x1.0p-42, 0x1.0p-39,
+ 0x1.0p-43, 0x1.0p-47, 0x1.0p-43, 0x1.0p-47,
+ 0x1.0p-50, 0x1.0p-54, 0x1.0p-57, 0x1.0p-60,
+ 0x1.0p-64, 0x1.0p-67, 0x1.0p-71, 0x1.0p-74,
+ 0x1.0p-68, 0x1.0p-71, 0x1.0p-74, 0x1.0p-77,
+ 0x1.0p-70, 0x1.0p-73, 0x1.0p-76, 0x1.0p-78,
+ 0x1.0p-81
+ };
static const int m1np[7][18] = {
{ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
{ 0, 0, 0, 0,36,48,60,72, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0},
@@ -63,7 +86,7 @@ __mpexp(mp_no *x, mp_no *y, int p) {
mp_no mps,mpak,mpt1,mpt2;
/* Choose m,n and compute a=2**(-m) */
- n = np[p]; m1 = m1p[p]; a = __mpexp_twomm1[p].d;
+ n = np[p]; m1 = m1p[p]; a = __mpexp_twomm1[p];
for (i=0; i<EX; i++) a *= RADIXI;
for ( ; i>EX; i--) a *= RADIX;
b = X[1]*RADIXI; m2 = 24*EX;
diff --git a/sysdeps/ieee754/dbl-64/mpexp.h b/sysdeps/ieee754/dbl-64/mpexp.h
index 2b26386072..401de58a34 100644
--- a/sysdeps/ieee754/dbl-64/mpexp.h
+++ b/sysdeps/ieee754/dbl-64/mpexp.h
@@ -27,90 +27,6 @@
#ifndef MPEXP_H
#define MPEXP_H
-extern const number __mpexp_twomm1[33] attribute_hidden;
-
-#ifndef AVOID_MPEXP_H
-#ifdef BIG_ENDI
- const number
- __mpexp_twomm1[33] = { /* 2**-m1 */
-/**/ {{0x3ff00000, 0x00000000} }, /* 1 */
-/**/ {{0x3ff00000, 0x00000000} }, /* 1 */
-/**/ {{0x3ff00000, 0x00000000} }, /* 1 */
-/**/ {{0x3ff00000, 0x00000000} }, /* 1 */
-/**/ {{0x3ee00000, 0x00000000} }, /* 2**-17 */
-/**/ {{0x3e800000, 0x00000000} }, /* 2**-23 */
-/**/ {{0x3e800000, 0x00000000} }, /* 2**-23 */
-/**/ {{0x3e300000, 0x00000000} }, /* 2**-28 */
-/**/ {{0x3e400000, 0x00000000} }, /* 2**-27 */
-/**/ {{0x3d900000, 0x00000000} }, /* 2**-38 */
-/**/ {{0x3d500000, 0x00000000} }, /* 2**-42 */
-/**/ {{0x3d800000, 0x00000000} }, /* 2**-39 */
-/**/ {{0x3d400000, 0x00000000} }, /* 2**-43 */
-/**/ {{0x3d000000, 0x00000000} }, /* 2**-47 */
-/**/ {{0x3d400000, 0x00000000} }, /* 2**-43 */
-/**/ {{0x3d000000, 0x00000000} }, /* 2**-47 */
-/**/ {{0x3cd00000, 0x00000000} }, /* 2**-50 */
-/**/ {{0x3c900000, 0x00000000} }, /* 2**-54 */
-/**/ {{0x3c600000, 0x00000000} }, /* 2**-57 */
-/**/ {{0x3c300000, 0x00000000} }, /* 2**-60 */
-/**/ {{0x3bf00000, 0x00000000} }, /* 2**-64 */
-/**/ {{0x3bc00000, 0x00000000} }, /* 2**-67 */
-/**/ {{0x3b800000, 0x00000000} }, /* 2**-71 */
-/**/ {{0x3b500000, 0x00000000} }, /* 2**-74 */
-/**/ {{0x3bb00000, 0x00000000} }, /* 2**-68 */
-/**/ {{0x3b800000, 0x00000000} }, /* 2**-71 */
-/**/ {{0x3b500000, 0x00000000} }, /* 2**-74 */
-/**/ {{0x3b200000, 0x00000000} }, /* 2**-77 */
-/**/ {{0x3b900000, 0x00000000} }, /* 2**-70 */
-/**/ {{0x3b600000, 0x00000000} }, /* 2**-73 */
-/**/ {{0x3b300000, 0x00000000} }, /* 2**-76 */
-/**/ {{0x3b100000, 0x00000000} }, /* 2**-78 */
-/**/ {{0x3ae00000, 0x00000000} }, /* 2**-81 */
- };
-
-#else
-#ifdef LITTLE_ENDI
- const number
- __mpexp_twomm1[33] = { /* 2**-m1 */
-/**/ {{0x00000000, 0x3ff00000} }, /* 1 */
-/**/ {{0x00000000, 0x3ff00000} }, /* 1 */
-/**/ {{0x00000000, 0x3ff00000} }, /* 1 */
-/**/ {{0x00000000, 0x3ff00000} }, /* 1 */
-/**/ {{0x00000000, 0x3ee00000} }, /* 2**-17 */
-/**/ {{0x00000000, 0x3e800000} }, /* 2**-23 */
-/**/ {{0x00000000, 0x3e800000} }, /* 2**-23 */
-/**/ {{0x00000000, 0x3e300000} }, /* 2**-28 */
-/**/ {{0x00000000, 0x3e400000} }, /* 2**-27 */
-/**/ {{0x00000000, 0x3d900000} }, /* 2**-38 */
-/**/ {{0x00000000, 0x3d500000} }, /* 2**-42 */
-/**/ {{0x00000000, 0x3d800000} }, /* 2**-39 */
-/**/ {{0x00000000, 0x3d400000} }, /* 2**-43 */
-/**/ {{0x00000000, 0x3d000000} }, /* 2**-47 */
-/**/ {{0x00000000, 0x3d400000} }, /* 2**-43 */
-/**/ {{0x00000000, 0x3d000000} }, /* 2**-47 */
-/**/ {{0x00000000, 0x3cd00000} }, /* 2**-50 */
-/**/ {{0x00000000, 0x3c900000} }, /* 2**-54 */
-/**/ {{0x00000000, 0x3c600000} }, /* 2**-57 */
-/**/ {{0x00000000, 0x3c300000} }, /* 2**-60 */
-/**/ {{0x00000000, 0x3bf00000} }, /* 2**-64 */
-/**/ {{0x00000000, 0x3bc00000} }, /* 2**-67 */
-/**/ {{0x00000000, 0x3b800000} }, /* 2**-71 */
-/**/ {{0x00000000, 0x3b500000} }, /* 2**-74 */
-/**/ {{0x00000000, 0x3bb00000} }, /* 2**-68 */
-/**/ {{0x00000000, 0x3b800000} }, /* 2**-71 */
-/**/ {{0x00000000, 0x3b500000} }, /* 2**-74 */
-/**/ {{0x00000000, 0x3b200000} }, /* 2**-77 */
-/**/ {{0x00000000, 0x3b900000} }, /* 2**-70 */
-/**/ {{0x00000000, 0x3b600000} }, /* 2**-73 */
-/**/ {{0x00000000, 0x3b300000} }, /* 2**-76 */
-/**/ {{0x00000000, 0x3b100000} }, /* 2**-78 */
-/**/ {{0x00000000, 0x3ae00000} }, /* 2**-81 */
- };
-
-#endif
-#endif
-#endif
-
#define RADIX 0x1.0p24 /* 2^24 */
#define RADIXI 0x1.0p-24 /* 2^-24 */
#define ZERO 0.0 /* 0 */