[git] CMU Common Lisp branch master updated. snapshot-2014-09-11-g32ad743

Raymond Toy rtoy at common-lisp.net
Sat Sep 20 20:48:16 UTC 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMU Common Lisp".

The branch, master has been updated
       via  32ad743155af81b7c3e2ee31726272a85e8f3247 (commit)
       via  68d2565d81c3db6aa23943d9f371213914b3747c (commit)
      from  128d65bef6e7d5c4d2701f05b2944bd5ec2223c9 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 32ad743155af81b7c3e2ee31726272a85e8f3247
Author: Raymond Toy <toy.raymond at gmail.com>
Date:   Sat Sep 20 13:48:07 2014 -0700

    Use fdlibm_setexception to signal appropriate exceptions.

diff --git a/src/lisp/e_log10.c b/src/lisp/e_log10.c
index f963cc7..73fa7f3 100644
--- a/src/lisp/e_log10.c
+++ b/src/lisp/e_log10.c
@@ -77,8 +77,8 @@ static double zero   =  0.0;
         k=0;
         if (hx < 0x00100000) {                  /* x < 2**-1022  */
             if (((hx&0x7fffffff)|lx)==0)
-                return -two54/zero;             /* log(+-0)=-inf */
-            if (hx<0) return (x-x)/zero;        /* log(-#) = NaN */
+              return fdlibm_setexception(-1.0, FDLIBM_DIVIDE_BY_ZERO); /* log(+-0)=-inf */
+            if (hx<0) return fdlibm_setexception(x-x, FDLIBM_INVALID); /* log(-#) = NaN */
             k -= 54; x *= two54; /* subnormal number, scale up x */
             ux.d = x;
             hx = ux.i[HIWORD];

commit 68d2565d81c3db6aa23943d9f371213914b3747c
Author: Raymond Toy <toy.raymond at gmail.com>
Date:   Sat Sep 20 13:27:43 2014 -0700

    Update to use a union.

diff --git a/src/lisp/e_log10.c b/src/lisp/e_log10.c
index dc7e312..f963cc7 100644
--- a/src/lisp/e_log10.c
+++ b/src/lisp/e_log10.c
@@ -68,9 +68,11 @@ static double zero   =  0.0;
 	double y,z;
 	int i,k,hx;
 	unsigned lx;
+	union { int i[2]; double d; } ux;
 
-	hx = __HI(x);	/* high word of x */
-	lx = __LO(x);	/* low word of x */
+        ux.d = x;
+        hx = ux.i[HIWORD];
+        lx = ux.i[LOWORD];
 
         k=0;
         if (hx < 0x00100000) {                  /* x < 2**-1022  */
@@ -78,14 +80,16 @@ static double zero   =  0.0;
                 return -two54/zero;             /* log(+-0)=-inf */
             if (hx<0) return (x-x)/zero;        /* log(-#) = NaN */
             k -= 54; x *= two54; /* subnormal number, scale up x */
-            hx = __HI(x);                /* high word of x */
+            ux.d = x;
+            hx = ux.i[HIWORD];
         }
 	if (hx >= 0x7ff00000) return x+x;
 	k += (hx>>20)-1023;
 	i  = ((unsigned)k&0x80000000)>>31;
         hx = (hx&0x000fffff)|((0x3ff-i)<<20);
         y  = (double)(k+i);
-        __HI(x) = hx;
+        ux.i[HIWORD] = hx;
+        x = ux.d;
 	z  = y*log10_2lo + ivln10*__ieee754_log(x);
 	return  z+y*log10_2hi;
 }

-----------------------------------------------------------------------

Summary of changes:
 src/lisp/e_log10.c |   16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)


hooks/post-receive
-- 
CMU Common Lisp



More information about the cmucl-cvs mailing list