Changeset 392


Ignore:
Timestamp:
Jan 25, 2004, 2:06:12 PM (21 years ago)
Author:
Gary Byers
Message:

Conditionalize use of WITH-STACK-SHORT-FLOATS, sortof.

Location:
trunk/ccl
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ccl/level-0/l0-float.lisp

    r307 r392  
    344344    ; maybe do usual first, catching error
    345345    (if (not (or (bignump num)(bignump den)))
    346       (with-stack-short-floats ((fnum num)
    347                                 (fden den))       
     346      (ppc32::with-stack-short-floats ((fnum num)
     347                                       (fden den))       
    348348        (%short-float/-2! fnum fden result))
    349349      (let* ((numlen (integer-length num))
     
    355355                 #|(not (minusp exp))|#
    356356                 (<= (abs exp) IEEE-single-float-mantissa-width))
    357           (with-stack-short-floats ((fnum num)
    358                                     (fden den))
     357          (ppc32::with-stack-short-floats ((fnum num)
     358                                           (fden den))
    359359            (%short-float/-2! fnum fden result))
    360360          (if (> exp IEEE-single-float-mantissa-width)
     
    386386
    387387
    388 
     388#+ppc32-target
    389389(defun %short-float (number &optional result)
    390390  (number-case number
     
    399399    (ratio
    400400     (%short-float-ratio number result))))
     401
     402#+ppc64-target
     403(defun %short-float (number)
     404  (number-case number
     405    (short-float number)
     406    (double-float (%double-float->short-float number))
     407    (fixnum (%fixnum-sfloat number))
     408    (bignum (%bignum-sfloat number))
     409    (ratio (%short-float-ratio number))))
    401410
    402411
     
    508517    (if (typep x 'double-float)
    509518      (%double-float-sin! x (%make-dfloat))
    510       (with-stack-short-floats ((sx x))
     519      (ppc32::with-stack-short-floats ((sx x))
    511520        (%single-float-sin! sx (%make-sfloat))))))
    512521
     
    519528    (if (typep x 'double-float)
    520529      (%double-float-cos! x (%make-dfloat))
    521       (with-stack-short-floats ((sx x))
     530      (ppc32::with-stack-short-floats ((sx x))
    522531        (%single-float-cos! sx (%make-sfloat))))))
    523532
     
    527536    (if (typep x 'double-float)
    528537      (%double-float-tan! x (%make-dfloat))
    529       (with-stack-short-floats ((sx x))
     538      (ppc32::with-stack-short-floats ((sx x))
    530539        (%single-float-tan! sx (%make-sfloat))))))
    531540
     
    540549                                 (dx x))
    541550        (%df-atan2 dy dx))
    542       (with-stack-short-floats ((sy y)
     551      (ppc32::with-stack-short-floats ((sy y)
    543552                                (sx x))
    544553        (%sf-atan2 sy sx)))
     
    549558      (if (typep y 'double-float)
    550559        (%double-float-atan! y (%make-dfloat))
    551         (with-stack-short-floats ((sy y))
     560        (ppc32::with-stack-short-floats ((sy y))
    552561          (%single-float-atan! sy (%make-sfloat)))))))
    553562
     
    585594         (%double-float-log! dx (%make-dfloat)))))
    586595    (t
    587      (with-stack-short-floats ((sx x))
     596     (ppc32::with-stack-short-floats ((sx x))
    588597       (if (minusp x)
    589598         (complex (%single-float-log! (%%short-float-abs sx sx) (%make-sfloat))
     
    597606    (complex (* (exp (realpart x)) (cis (imagpart x))))
    598607    (double-float (%double-float-exp! x (%make-dfloat)))
    599     (t (with-stack-short-floats ((sx x))
     608    (t (ppc32::with-stack-short-floats ((sx x))
    600609         (%single-float-exp! sx (%make-sfloat))))))
    601610
     
    614623                                      (e1 e))
    615624             (%double-float-expt! b1 e1 (%make-dfloat)))
    616            (with-stack-short-floats ((b1 b)
     625           (ppc32::with-stack-short-floats ((b1 b)
    617626                                     (e1 e))
    618627             (%single-float-expt! b1 e1 (%make-sfloat)))))
     
    635644                          (* (setq b (isqrt d)) b)))))
    636645         (/ a b))         
    637         (t (with-stack-short-floats ((f1))
     646        (t (ppc32::with-stack-short-floats ((f1))
    638647             (fsqrt (%short-float x f1))))))
    639648
     
    677686        (%double-float-acos! x (%make-sfloat))
    678687        (- double-float-half-pi (asin x))))
    679     (with-stack-short-floats ((sx x))
     688    (ppc32::with-stack-short-floats ((sx x))
    680689      (locally
    681690          (declare (type short-float sx))
  • trunk/ccl/level-0/l0-numbers.lisp

    r308 r392  
    424424  (if (and (eq int 0)(= sfloat 0.0s0))
    425425    0
    426     (with-stack-short-floats ((tem int))
     426    (ppc32::with-stack-short-floats ((tem int))
    427427      (if (= tem sfloat)
    428428        0
     
    988988                     (%double-float--2 fnum (%double-float*-2! (%double-float res f2) ,divisor f2))))))
    989989       (truncate-rat-sfloat (number divisor)
    990          `(with-stack-short-floats ((fnum ,number)
     990         `(ppc32::with-stack-short-floats ((fnum ,number)
    991991                                    (f2))
    992992           (let ((res (%unary-truncate (%short-float/-2! fnum ,divisor f2))))
     
    10281028                     (number-case divisor
    10291029                       (short-float
    1030                         (with-stack-short-floats ((f2))
     1030                        (ppc32::with-stack-short-floats ((f2))
    10311031                          (let ((res (%unary-truncate (%short-float/-2! number divisor f2))))
    10321032                            (values res
     
    10351035                                     (%short-float*-2! (%short-float res f2) divisor f2))))))
    10361036                       ((fixnum bignum ratio)
    1037                         (with-stack-short-floats ((fdiv divisor)
     1037                        (ppc32::with-stack-short-floats ((fdiv divisor)
    10381038                                                  (f2))
    10391039                          (let ((res (%unary-truncate (%short-float/-2! number fdiv f2))))
     
    10851085         (%unary-truncate (%double-float/-2! fnum ,divisor f2))))
    10861086     (truncate-rat-sfloat (number divisor)
    1087        `(with-stack-short-floats ((fnum ,number)
     1087       `(ppc32::with-stack-short-floats ((fnum ,number)
    10881088                                      (f2))
    10891089         (%unary-truncate (%short-float/-2! fnum ,divisor f2)))))
     
    11391139                    (number-case divisor
    11401140                      ((fixnum bignum ratio)
    1141                        (with-stack-short-floats ((fdiv divisor)
     1141                       (ppc32::with-stack-short-floats ((fdiv divisor)
    11421142                                                 (f2))
    11431143                         (let ((res (%unary-truncate (%short-float/-2! number fdiv f2))))
    11441144                           RES)))
    11451145                      (short-float
    1146                        (with-stack-short-floats ((ddiv divisor)
     1146                       (ppc32::with-stack-short-floats ((ddiv divisor)
    11471147                                                      (f2))
    11481148                         (%unary-truncate (%short-float/-2! number ddiv f2))))
  • trunk/ccl/level-1/l1-numbers.lisp

    r315 r392  
    431431(defun %single-float-expt! (b e result)
    432432  (declare (single-float b e result))
    433   (with-stack-short-floats ((temp))
     433  (ppc32::with-stack-short-floats ((temp))
    434434    (%setf-short-float temp (#_powf b e))
    435435    (%sf-check-exception-2 'expt b e (%ffi-exception-status))
     
    456456(defun %single-float-sin! (n result)
    457457  (declare (single-float n result))
    458   (with-stack-short-floats ((temp))
     458  (ppc32::with-stack-short-floats ((temp))
    459459    (%setf-short-float TEMP (#_sinf n))
    460460    (%sf-check-exception-1 'sin n (%ffi-exception-status))
     
    479479(defun %single-float-cos! (n result)
    480480  (declare (single-float n result))
    481   (with-stack-short-floats ((temp))
     481  (ppc32::with-stack-short-floats ((temp))
    482482    (%setf-short-float TEMP (#_cosf n))
    483483    (%sf-check-exception-1 'cos n (%ffi-exception-status))
     
    502502(defun %single-float-acos! (n result)
    503503  (declare (single-float n result))
    504   (with-stack-short-floats ((temp))
     504  (ppc32::with-stack-short-floats ((temp))
    505505    (%setf-short-float TEMP (#_acosf n))
    506506    (%sf-check-exception-1 'acos n (%ffi-exception-status))
     
    525525(defun %single-float-asin! (n result)
    526526  (declare (single-float n result))
    527   (with-stack-short-floats ((temp))
     527  (ppc32::with-stack-short-floats ((temp))
    528528    (%setf-short-float TEMP (#_asinf n))
    529529    (%sf-check-exception-1 'asin n (%ffi-exception-status))
     
    548548(defun %single-float-cosh! (n result)
    549549  (declare (single-float n result))
    550   (with-stack-short-floats ((temp))
     550  (ppc32::with-stack-short-floats ((temp))
    551551    (%setf-short-float TEMP (#_coshf n))
    552552    (%sf-check-exception-1 'cosh n (%ffi-exception-status))
     
    571571(defun %single-float-log! (n result)
    572572  (declare (single-float n result))
    573   (with-stack-short-floats ((temp))
     573  (ppc32::with-stack-short-floats ((temp))
    574574    (%setf-short-float TEMP (#_logf n))
    575575    (%sf-check-exception-1 'log n (%ffi-exception-status))
     
    594594(defun %single-float-tan! (n result)
    595595  (declare (single-float n result))
    596   (with-stack-short-floats ((temp))
     596  (ppc32::with-stack-short-floats ((temp))
    597597    (%setf-short-float TEMP (#_tanf n))
    598598    (%sf-check-exception-1 'tan n (%ffi-exception-status))
     
    618618(defun %single-float-atan! (n result)
    619619  (declare (single-float n result))
    620   (with-stack-short-floats ((temp))
     620  (ppc32::with-stack-short-floats ((temp))
    621621    (%setf-short-float TEMP (#_atanf n))
    622622    (%sf-check-exception-1 'atan n (%ffi-exception-status))
     
    642642(defun %single-float-atan2! (x y result)
    643643  (declare (single-float x y result))
    644   (with-stack-short-floats ((temp))
     644  (ppc32::with-stack-short-floats ((temp))
    645645    (%setf-short-float TEMP (#_atan2f x y))
    646646    (%sf-check-exception-2 'atan2 x y (%ffi-exception-status))
     
    666666(defun %single-float-exp! (n result)
    667667  (declare (single-float n result))
    668   (with-stack-short-floats ((temp))
     668  (ppc32::with-stack-short-floats ((temp))
    669669    (%setf-short-float TEMP (#_expf n))
    670670    (%sf-check-exception-1 'exp n (%ffi-exception-status))
     
    689689(defun %single-float-sinh! (n result)
    690690  (declare (single-float n result))
    691   (with-stack-short-floats ((temp))
     691  (ppc32::with-stack-short-floats ((temp))
    692692    (%setf-short-float TEMP (#_sinhf n))
    693693    (%sf-check-exception-1 'sinh n (%ffi-exception-status))
     
    715715(defun %single-float-tanh! (n result)
    716716  (declare (single-float n result))
    717   (with-stack-short-floats ((temp))
     717  (ppc32::with-stack-short-floats ((temp))
    718718    (%setf-short-float TEMP (#_tanhf n))
    719719    (%sf-check-exception-1 'tanh n (%ffi-exception-status))
     
    739739(defun %single-float-asinh! (n result)
    740740  (declare (single-float n result))
    741   (with-stack-short-floats ((temp))
     741  (ppc32::with-stack-short-floats ((temp))
    742742    (%setf-short-float TEMP (#_asinhf n))
    743743    (%sf-check-exception-1 'asinh n (%ffi-exception-status))
     
    763763(defun %single-float-acosh! (n result)
    764764  (declare (single-float n result))
    765   (with-stack-short-floats ((temp))
     765  (ppc32::with-stack-short-floats ((temp))
    766766    (%setf-short-float TEMP (#_acoshf n))
    767767    (%sf-check-exception-1 'acosh n (%ffi-exception-status))
     
    786786(defun %single-float-atanh! (n result)
    787787  (declare (single-float n result))
    788   (with-stack-short-floats ((temp))
     788  (ppc32::with-stack-short-floats ((temp))
    789789    (%setf-short-float TEMP (#_atanhf n))
    790790    (%sf-check-exception-1 'atanh n (%ffi-exception-status))
     
    809809(defun %single-float-sqrt! (n result)
    810810  (declare (single-float n result))
    811   (with-stack-short-floats ((temp))
     811  (ppc32::with-stack-short-floats ((temp))
    812812    (%setf-short-float TEMP (#_sqrtf n))
    813813    (%sf-check-exception-1 'sqrt n (%ffi-exception-status))
  • trunk/ccl/lib/numbers.lisp

    r325 r392  
    591591    (if (typep x 'double-float)
    592592      (%double-float-sinh! x (%make-dfloat))
    593       (with-stack-short-floats ((sx x))
     593      (ppc32::with-stack-short-floats ((sx x))
    594594        (%single-float-sinh! sx (%make-sfloat))))))
    595595
     
    600600    (if (typep x 'double-float)
    601601      (%double-float-cosh! x (%make-dfloat))
    602       (with-stack-short-floats ((sx x))
     602      (ppc32::with-stack-short-floats ((sx x))
    603603        (%single-float-cosh! sx (%make-sfloat))))))
    604604
     
    608608    (if (typep x 'double-float)
    609609      (%double-float-tanh! x (%make-dfloat))
    610       (with-stack-short-floats ((sx x))
     610      (ppc32::with-stack-short-floats ((sx x))
    611611        (%single-float-tanh! sx (%make-sfloat))))))
    612612
     
    616616    (if (typep x 'double-float)
    617617      (%double-float-asinh! x (%make-dfloat))
    618       (with-stack-short-floats ((sx x))
     618      (ppc32::with-stack-short-floats ((sx x))
    619619        (%single-float-asinh! sx (%make-sfloat))))))
    620620
     
    623623    (if (typep x 'double-float)
    624624      (%double-float-acosh! x (%make-dfloat))
    625       (with-stack-short-floats ((sx x))
     625      (ppc32::with-stack-short-floats ((sx x))
    626626        (%single-float-acosh! sx (%make-sfloat))))
    627627    (* 2 (log (+ (sqrt (/ (1+ x) 2)) (sqrt (/ (1- x) 2)))))))
Note: See TracChangeset for help on using the changeset viewer.