[Sbcl-commits] master: Fix clisp cross-compile

 [Sbcl-commits] master: Fix clisp cross-compile From: Christophe Rhodes - 2012-09-15 17:42:51 ```The branch "master" has been updated in SBCL: via 508bdb85a65b4530e9d8c4b978539393f64cb234 (commit) from 239125681cb03e2cce08a50e9bf03589956fd125 (commit) - Log ----------------------------------------------------------------- commit 508bdb85a65b4530e9d8c4b978539393f64cb234 Author: Christophe Rhodes Date: Sat Sep 15 18:39:23 2012 +0100 Fix clisp cross-compile Problems: * least-positive-long-float is unrepresentable in clisp, ending up with being zero * clisp's decode-float returns a 0 exponent for a 0 float (rather than something large and negative) * everything got constant-folded in the cross-compiler, thus using the host's runtime. Solution: compute the value using sb!vm:double-float-digits/bias --- src/code/reader.lisp | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/code/reader.lisp b/src/code/reader.lisp index 08a5286..8f885fa 100644 --- a/src/code/reader.lisp +++ b/src/code/reader.lisp @@ -1415,17 +1415,17 @@ extended :: syntax." ;; and convert to base-10 conservatively at the end. ;; Use the least positive float, because denormalized exponent ;; can be larger than normalized. - (let* ((max-exponent (- (nth-value - 1 - (decode-float least-positive-long-float)))) + (let* ((max-exponent + #!-long-float + (+ sb!vm:double-float-digits sb!vm:double-float-bias)) (number-magnitude (integer-length number)) (divisor-magnitude (1- (integer-length divisor))) (magnitude (- number-magnitude divisor-magnitude))) (if (minusp exponent) (max exponent (ceiling (- (+ max-exponent magnitude)) - (floor (log 10 2)))) + #.(floor (log 10 2)))) (min exponent (floor (- max-exponent magnitude) - (floor (log 10 2))))))) + #.(floor (log 10 2))))))) (defun make-float (stream) ;; Assume that the contents of *read-buffer* are a legal float, with nothing ----------------------------------------------------------------------- hooks/post-receive -- SBCL ```

 [Sbcl-commits] master: Fix clisp cross-compile From: Christophe Rhodes - 2012-09-15 17:42:51 ```The branch "master" has been updated in SBCL: via 508bdb85a65b4530e9d8c4b978539393f64cb234 (commit) from 239125681cb03e2cce08a50e9bf03589956fd125 (commit) - Log ----------------------------------------------------------------- commit 508bdb85a65b4530e9d8c4b978539393f64cb234 Author: Christophe Rhodes Date: Sat Sep 15 18:39:23 2012 +0100 Fix clisp cross-compile Problems: * least-positive-long-float is unrepresentable in clisp, ending up with being zero * clisp's decode-float returns a 0 exponent for a 0 float (rather than something large and negative) * everything got constant-folded in the cross-compiler, thus using the host's runtime. Solution: compute the value using sb!vm:double-float-digits/bias --- src/code/reader.lisp | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/code/reader.lisp b/src/code/reader.lisp index 08a5286..8f885fa 100644 --- a/src/code/reader.lisp +++ b/src/code/reader.lisp @@ -1415,17 +1415,17 @@ extended :: syntax." ;; and convert to base-10 conservatively at the end. ;; Use the least positive float, because denormalized exponent ;; can be larger than normalized. - (let* ((max-exponent (- (nth-value - 1 - (decode-float least-positive-long-float)))) + (let* ((max-exponent + #!-long-float + (+ sb!vm:double-float-digits sb!vm:double-float-bias)) (number-magnitude (integer-length number)) (divisor-magnitude (1- (integer-length divisor))) (magnitude (- number-magnitude divisor-magnitude))) (if (minusp exponent) (max exponent (ceiling (- (+ max-exponent magnitude)) - (floor (log 10 2)))) + #.(floor (log 10 2)))) (min exponent (floor (- max-exponent magnitude) - (floor (log 10 2))))))) + #.(floor (log 10 2))))))) (defun make-float (stream) ;; Assume that the contents of *read-buffer* are a legal float, with nothing ----------------------------------------------------------------------- hooks/post-receive -- SBCL ```