0.8.3.20:
authorChristophe Rhodes <csr21@cam.ac.uk>
Mon, 1 Sep 2003 14:44:44 +0000 (14:44 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Mon, 1 Sep 2003 14:44:44 +0000 (14:44 +0000)
Fixed bug revealed by PFD in *.26:
... (FLOAT X) should be transformed to guard against X already
being a float, in which case no coercion should occur.
Minor adjustments:
... tighten up the type of RANDOM;
... textual frobs around RANDOM area.
(there's an extremely strange bug in RANDOM on the powerpc,
which I haven't yet logged but will do if I can't figure out
what's going on)

NEWS
src/code/target-random.lisp
src/compiler/float-tran.lisp
src/compiler/fndb.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 8802722..97fb78a 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -2027,6 +2027,8 @@ changes in sbcl-0.8.4 relative to sbcl-0.8.3:
     ** the RETURN clause in LOOP is now equivalent to DO (RETURN ...).
     ** ROUND and FROUND now give the right answer when given very
        small float arguments.
+    ** (FLOAT X) for X of type DOUBLE-FLOAT now returns X in all
+       circumstances.
 
 planned incompatible changes in 0.8.x:
   * (not done yet, but planned:) When the profiling interface settles
index 28c4db4..e7a65a7 100644 (file)
 
 (defun random (arg &optional (state *random-state*))
   (declare (inline %random-single-float %random-double-float
-                  #!+long-float %long-float))
+                  #!+long-float %random-long-float))
   (cond
     ((and (fixnump arg) (<= arg random-fixnum-max) (> arg 0))
      (rem (random-chunk state) arg))
index f2880de..42f18fa 100644 (file)
 (defknown %single-float (real) single-float (movable foldable flushable))
 (defknown %double-float (real) double-float (movable foldable flushable))
 
-(deftransform float ((n &optional f) (* &optional single-float) *)
+(deftransform float ((n f) (* single-float) *)
   '(%single-float n))
 
 (deftransform float ((n f) (* double-float) *)
   '(%double-float n))
 
+(deftransform float ((n) *)
+  '(if (floatp n)
+       n
+       (%single-float n)))
+
 (deftransform %single-float ((n) (single-float) *)
   'n)
 
index 3215e85..7554aaa 100644 (file)
   (movable foldable flushable))
 (defknown deposit-field (integer byte-specifier integer) integer
   (movable foldable flushable))
-(defknown random ((real (0)) &optional random-state) (real 0) ())
+(defknown random ((or (float (0.0)) (integer 1)) &optional random-state)
+  (or (float 0.0) (integer 0)) ())
 (defknown make-random-state (&optional (or (member nil t) random-state))
   random-state (flushable))
 (defknown random-state-p (t) boolean (movable foldable flushable))
index be78747..d1e0356 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".)
-"0.8.3.19"
+"0.8.3.20"