From: Christophe Rhodes Date: Sat, 15 Sep 2012 17:39:23 +0000 (+0100) Subject: Fix clisp cross-compile X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=508bdb85a65b4530e9d8c4b978539393f64cb234;p=sbcl.git 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 --- 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