This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Remove unnecessary __mpexp_nn


Hi,

__mpexp_nn is an array of floats such that __mpexp[i] == (double)i.
Eliminated with this patch since it is a completely unnecessary memory
reference.  Tested to verify that it does not cause any regressions in
the testsuite.  OK for 2.18?

Siddhesh

ChangeLog:

	* sysdeps/ieee754/dbl-64/mpexp.c (__mpexp): Eliminate __mpexp_nn
	and use variable directly.
	* sysdeps/ieee754/dbl-64/mpexp.h (__mpexp_nn): Remove.

diff --git a/sysdeps/ieee754/dbl-64/mpexp.c b/sysdeps/ieee754/dbl-64/mpexp.c
index 2762ba9..c5a0283 100644
--- a/sysdeps/ieee754/dbl-64/mpexp.c
+++ b/sysdeps/ieee754/dbl-64/mpexp.c
@@ -81,12 +81,12 @@ __mpexp(mp_no *x, mp_no *y, int p) {
   __mul(x,&mpt1,&mps,p);
 
   /* Evaluate the polynomial. Put result in mpt2 */
-  mpk.e = 1;   mpk.d[0] = ONE;   mpk.d[1]=__mpexp_nn[n].d;
+  mpk.e = 1;   mpk.d[0] = ONE;   mpk.d[1]=n;
   __dvd(&mps,&mpk,&mpt1,p);
   __add(&mpone,&mpt1,&mpak,p);
   for (k=n-1; k>1; k--) {
     __mul(&mps,&mpak,&mpt1,p);
-    mpk.d[1]=__mpexp_nn[k].d;
+    mpk.d[1] = k;
     __dvd(&mpt1,&mpk,&mpt2,p);
     __add(&mpone,&mpt2,&mpak,p);
   }
diff --git a/sysdeps/ieee754/dbl-64/mpexp.h b/sysdeps/ieee754/dbl-64/mpexp.h
index 390e272..758255b 100644
--- a/sysdeps/ieee754/dbl-64/mpexp.h
+++ b/sysdeps/ieee754/dbl-64/mpexp.h
@@ -28,7 +28,6 @@
 #define MPEXP_H
 
 extern const number __mpexp_twomm1[33] attribute_hidden;
-extern const number __mpexp_nn[9] attribute_hidden;
 extern const number __mpexp_radix attribute_hidden;
 extern const number __mpexp_radixi attribute_hidden;
 extern const number __mpexp_zero attribute_hidden;
@@ -75,18 +74,6 @@ extern const number __mpexp_half attribute_hidden;
 /**/                  {{0x3b100000, 0x00000000} }, /* 2**-78 */
 /**/                  {{0x3ae00000, 0x00000000} }, /* 2**-81 */
   };
-  const number
-	       __mpexp_nn[9]={                     /* n      */
-/**/                  {{0x00000000, 0x00000000} }, /* 0      */
-/**/                  {{0x3ff00000, 0x00000000} }, /* 1      */
-/**/                  {{0x40000000, 0x00000000} }, /* 2      */
-/**/                  {{0x40080000, 0x00000000} }, /* 3      */
-/**/                  {{0x40100000, 0x00000000} }, /* 4      */
-/**/                  {{0x40140000, 0x00000000} }, /* 5      */
-/**/                  {{0x40180000, 0x00000000} }, /* 6      */
-/**/                  {{0x401c0000, 0x00000000} }, /* 7      */
-/**/                  {{0x40200000, 0x00000000} }, /* 8      */
-  };
 
   const number
 /**/ __mpexp_radix    = {{0x41700000, 0x00000000} }, /* 2**24  */
@@ -135,19 +122,6 @@ extern const number __mpexp_half attribute_hidden;
 /**/                  {{0x00000000, 0x3ae00000} }, /* 2**-81 */
   };
   const number
-	       __mpexp_nn[9]={                     /* n      */
-/**/                  {{0x00000000, 0x00000000} }, /* 0      */
-/**/                  {{0x00000000, 0x3ff00000} }, /* 1      */
-/**/                  {{0x00000000, 0x40000000} }, /* 2      */
-/**/                  {{0x00000000, 0x40080000} }, /* 3      */
-/**/                  {{0x00000000, 0x40100000} }, /* 4      */
-/**/                  {{0x00000000, 0x40140000} }, /* 5      */
-/**/                  {{0x00000000, 0x40180000} }, /* 6      */
-/**/                  {{0x00000000, 0x401c0000} }, /* 7      */
-/**/                  {{0x00000000, 0x40200000} }, /* 8      */
-  };
-
-  const number
 /**/ __mpexp_radix    = {{0x00000000, 0x41700000} }, /* 2**24  */
 /**/ __mpexp_radixi   = {{0x00000000, 0x3e700000} }, /* 2**-24 */
 /**/ __mpexp_zero     = {{0x00000000, 0x00000000} }, /* 0      */


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]