From: Christophe Rhodes Date: Mon, 1 Sep 2003 14:44:44 +0000 (+0000) Subject: 0.8.3.20: X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=10079735369606be93965175c0e2750e1f893824;p=sbcl.git 0.8.3.20: 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) --- diff --git a/NEWS b/NEWS index 8802722..97fb78a 100644 --- 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 diff --git a/src/code/target-random.lisp b/src/code/target-random.lisp index 28c4db4..e7a65a7 100644 --- a/src/code/target-random.lisp +++ b/src/code/target-random.lisp @@ -259,7 +259,7 @@ (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)) diff --git a/src/compiler/float-tran.lisp b/src/compiler/float-tran.lisp index f2880de..42f18fa 100644 --- a/src/compiler/float-tran.lisp +++ b/src/compiler/float-tran.lisp @@ -18,12 +18,17 @@ (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) diff --git a/src/compiler/fndb.lisp b/src/compiler/fndb.lisp index 3215e85..7554aaa 100644 --- a/src/compiler/fndb.lisp +++ b/src/compiler/fndb.lisp @@ -393,7 +393,8 @@ (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)) diff --git a/version.lisp-expr b/version.lisp-expr index be78747..d1e0356 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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"