>>>>> "Martin" == Martin Raspaud <[EMAIL PROTECTED]> writes:

    Martin> Martin Raspaud wrote:

    >> Hi all
    >> [...]
    >> 
    >> (defmacro define-IEEE-float (name
    >> &key (sign-bits 1)
    >> (exponant-bits 8)
    >> (mantissa-bits 23)
    >> (bias 127)
    >> (associated-type 'float))
    >> (with-gensyms (significant exponant sign s-bits e-bits m-bits b
    >> value)
    >> `(defun ,(intern (string-upcase (format nil "read-~s" name))) ()
    >> (let* ((,s-bits ,sign-bits)
    >> (,e-bits ,exponant-bits)
    >> (,m-bits ,mantissa-bits)
    >> (,b ,bias)
    >> (,value (read-unsigned-integer (/ (+ ,s-bits ,e-bits
    >> ,m-bits) 8)))
    >> (,significant (+ (ash 1 ,m-bits) (logand (1- (ash 1
    >> ,m-bits)) ,value)))
    >> (,exponant (- (logand (1- (ash 1 ,e-bits)) (ash ,value (-
    >> ,m-bits))) ,b))
    >> (,sign (ash ,value (- (+ ,e-bits ,m-bits)))))
    >> (* ,significant (expt 2 ,exponant) (expt (coerce -1
    >> ,associated-type) ,sign))))))
    >> [...]

    Martin> Ok, I found a solution : take que coerce out of the multiplication and
    Martin> put it arround (* ,significant ....)
    Martin> Apparently it's better to let cmucl handle the type itself until the end...

The compiler is trying to derive the result type of a call to,
essentially, (float x 1d0) when x is very large.  The compiler should
just give up in this case, probably.

But at least you have a workaround for now.

Ray


Reply via email to