1.0.37.63: Test for the correct range when eliding range reduction on x87
authorPaul Khuong <pvk@pvk.ca>
Mon, 26 Apr 2010 21:15:34 +0000 (21:15 +0000)
committerPaul Khuong <pvk@pvk.ca>
Mon, 26 Apr 2010 21:15:34 +0000 (21:15 +0000)
 * We now test for a maximal magnitude of 2^63, not 2^64.

NEWS
src/compiler/float-tran.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 4805c10..7c4b267 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -65,6 +65,8 @@ changes relative to sbcl-1.0.37:
   * bug fix: GCD always returns positive values. (lp#413680)
   * bug fix: Converting division to multiplication by reciprocal handles
     denormals.
+  * bug fix: We were too eager in eliding range reduction tests on x87.
+    The maximal magnitude is 2^63, not 2^64.
 
 changes in sbcl-1.0.37 relative to sbcl-1.0.36:
   * enhancement: Backtrace from THROW to uncaught tag on x86oids now shows
index a5680e2..6efa676 100644 (file)
   (def single-float)
   (def double-float))
 
-;;; Optimize addition and subsctraction of zero
+;;; Optimize addition and subtraction of zero
 (macrolet ((def (op type &rest args)
              `(deftransform ,op ((x y) (,type (constant-arg (member ,@args))) *
                                  ;; Beware the SNaN!
                 (deftransform ,name ((x) (single-float) *)
                   #!+x86 (cond ((csubtypep (lvar-type x)
                                            (specifier-type '(single-float
-                                                             (#.(- (expt 2f0 64)))
-                                                             (#.(expt 2f0 64)))))
+                                                             (#.(- (expt 2f0 63)))
+                                                             (#.(expt 2f0 63)))))
                                 `(coerce (,',prim-quick (coerce x 'double-float))
                                   'single-float))
                                (t
                                 (compiler-notify
                                  "unable to avoid inline argument range check~@
-                                  because the argument range (~S) was not within 2^64"
+                                  because the argument range (~S) was not within 2^63"
                                  (type-specifier (lvar-type x)))
                                 `(coerce (,',prim (coerce x 'double-float)) 'single-float)))
                   #!-x86 `(coerce (,',prim (coerce x 'double-float)) 'single-float))
                (deftransform ,name ((x) (double-float) *)
                  #!+x86 (cond ((csubtypep (lvar-type x)
                                           (specifier-type '(double-float
-                                                            (#.(- (expt 2d0 64)))
-                                                            (#.(expt 2d0 64)))))
+                                                            (#.(- (expt 2d0 63)))
+                                                            (#.(expt 2d0 63)))))
                                `(,',prim-quick x))
                               (t
                                (compiler-notify
                                 "unable to avoid inline argument range check~@
-                                 because the argument range (~S) was not within 2^64"
+                                 because the argument range (~S) was not within 2^63"
                                 (type-specifier (lvar-type x)))
                                `(,',prim x)))
                  #!-x86 `(,',prim x)))))
index 10b7429..b5e1381 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.37.62"
+"1.0.37.63"