about summary refs log tree commit diff
diff options
context:
space:
mode:
authorSiddhesh Poyarekar <siddhesh@redhat.com>2013-04-02 17:53:09 +0530
committerSiddhesh Poyarekar <siddhesh@redhat.com>2013-04-02 17:53:09 +0530
commite7906a4789f9f6ac4cd4a99522832753887a8cc7 (patch)
tree6981bda7d5a0e33ba4ced1530deb3b08701e55f7
parent92e3664bb597c61c581d02c833729d484de726ad (diff)
downloadglibc-e7906a4789f9f6ac4cd4a99522832753887a8cc7.tar.gz
glibc-e7906a4789f9f6ac4cd4a99522832753887a8cc7.tar.xz
glibc-e7906a4789f9f6ac4cd4a99522832753887a8cc7.zip
Use mantissa_t in mpexp
-rw-r--r--ChangeLog3
-rw-r--r--sysdeps/ieee754/dbl-64/mpa.h3
-rw-r--r--sysdeps/ieee754/dbl-64/mpexp.c4
3 files changed, 7 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 0d7e23526e..22b8214c11 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2013-04-02  Siddhesh Poyarekar  <siddhesh@redhat.com>
 
+	* sysdeps/ieee754/dbl-64/mpa.h (HALFRAD): Define as TWO23.
+	* sysdeps/ieee754/dbl-64/mpexp.c (__mpexp): Use mantissa_t.
+
 	* bench/Makefile (bench): Add sin and slowsin.
 	* benchtests/sin-inputs: New file.
 	* benchtests/slowsin-inputs: New file.
diff --git a/sysdeps/ieee754/dbl-64/mpa.h b/sysdeps/ieee754/dbl-64/mpa.h
index ee81f5cbef..0d8211517f 100644
--- a/sysdeps/ieee754/dbl-64/mpa.h
+++ b/sysdeps/ieee754/dbl-64/mpa.h
@@ -100,6 +100,8 @@ extern const mp_no mptwo;
 #define  TWO19     TWOPOW (19)		/* 2^19    */
 #define  TWO23     TWOPOW (23)		/* 2^23    */
 
+#define  HALFRAD   TWO23
+
 #define  TWO57     0x1.0p57		/* 2^57    */
 #define  TWO71     0x1.0p71		/* 2^71    */
 #define  TWOM1032  0x1.0p-1032		/* 2^-1032 */
@@ -107,7 +109,6 @@ extern const mp_no mptwo;
 
 #define  HALF      0x1.0p-1		/* 1/2 */
 #define  MHALF     -0x1.0p-1		/* -1/2 */
-#define  HALFRAD   0x1.0p23		/* 2^23 */
 
 int __acr (const mp_no *, const mp_no *, int);
 void __cpy (const mp_no *, mp_no *, int);
diff --git a/sysdeps/ieee754/dbl-64/mpexp.c b/sysdeps/ieee754/dbl-64/mpexp.c
index a219401228..06347b74b8 100644
--- a/sysdeps/ieee754/dbl-64/mpexp.c
+++ b/sysdeps/ieee754/dbl-64/mpexp.c
@@ -43,7 +43,7 @@ SECTION
 __mpexp (mp_no *x, mp_no *y, int p)
 {
   int i, j, k, m, m1, m2, n;
-  double b;
+  mantissa_t 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,
@@ -80,7 +80,7 @@ __mpexp (mp_no *x, mp_no *y, int p)
   b = X[1];
   m2 = 24 * EX;
   for (; b < HALFRAD; m2--)
-    b *= TWO;
+    b *= 2;
   if (b == HALFRAD)
     {
       for (i = 2; i <= p; i++)