Changeset 15647


Ignore:
Timestamp:
Feb 2, 2013, 5:59:58 PM (6 years ago)
Author:
gb
Message:

Work around Linux #_exp lossage another way.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/level-1/l1-numbers.lisp

    r15628 r15647  
    762762  (with-stack-double-floats ((temp))
    763763    #+arm-target (%set-fpscr-status 0)
    764     #+linux-target
    765     (progn
    766       (%get-errno)                      ;clear errno
    767       (#_feclearexcept #$FE_ALL_EXCEPT))
    768764    #-freebsdx8632-target
    769765    (%setf-double-float TEMP (#_exp n))
     
    772768    (%df-check-exception-1 'exp n (%ffi-exception-status))
    773769    #+linux-target
    774     (and (eql (- #$ERANGE) (%get-errno))
    775          (#_fetestexcept #$FE_OVERFLOW)
     770    (and (infinity-p TEMP)
    776771         (get-fpu-mode :overflow)
    777772         (error 'floating-point-overflow
     
    785780  (target::with-stack-short-floats ((temp))
    786781    #+arm-target (%set-fpscr-status 0)
    787     #+linux-target
    788     (progn
    789       (%get-errno)                      ;clear errno
    790       (#_feclearexcept #$FE_ALL_EXCEPT))
    791782    #-freebsdx8632-target
    792783    (%setf-short-float TEMP (#_expf n))
     
    795786    (%sf-check-exception-1 'exp n (%ffi-exception-status))
    796787    #+linux-target
    797     (and (eql (- #$ERANGE) (%get-errno))
    798          (#_fetestexcept #$FE_OVERFLOW)
     788    (and (infinity-p TEMP)
    799789         (get-fpu-mode :overflow)
    800790         (error 'floating-point-overflow
     
    814804(defun %single-float-exp (n)
    815805  (declare (single-float n))
    816   #+linux-target
    817   (progn
    818     (%get-errno)                      ;clear errno
    819     (#_feclearexcept #$FE_ALL_EXCEPT))
    820806  (let* ((result (#_expf n)))
    821807    (%sf-check-exception-1 'exp n (%ffi-exception-status))
    822808    #+linux-target
    823     (and (eql (- #$ERANGE) (%get-errno))
    824          (#_fetestexcept #$FE_OVERFLOW)
     809    (and (infinity-p result)
    825810         (get-fpu-mode :overflow)
    826811         (error 'floating-point-overflow
Note: See TracChangeset for help on using the changeset viewer.