Changeset 7811


Ignore:
Timestamp:
Dec 4, 2007, 9:55:28 PM (13 years ago)
Author:
rme
Message:

Darwin/PPC32 has had single-precision variants of sin/cos/etc. for
a while now. Remove special case treatment of it, and just conditionalize
on 32/64 bit.

Location:
branches/ia32
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • branches/ia32/level-1/l1-numbers.lisp

    r6027 r7811  
    463463    (%setf-double-float result TEMP)))
    464464
    465 #+(and ppc32-target (not darwinppc-target))
     465#+32-bit-target
    466466(defun %single-float-expt! (b e result)
    467467  (declare (single-float b e result))
    468   (ppc32::with-stack-short-floats ((temp))
     468  (with-stack-short-floats ((temp))
    469469    (%setf-short-float temp (#_powf b e))
    470470    (%sf-check-exception-2 'expt b e (%ffi-exception-status))
    471471    (%setf-short-float result TEMP)))
    472 
    473 #+(and ppc32-target darwinppc-target)
    474 (defun %single-float-expt! (b e result)
    475   (declare (single-float b e result))
    476   (with-stack-double-floats ((b2 b)
    477                              (e2 e)
    478                              (result2))
    479     (%double-float-expt! b2 e2 result2)
    480     (%double-float->short-float result2 result)))
    481472
    482473#+64-bit-target
     
    494485    (%setf-double-float result TEMP)))
    495486
    496 #+(and ppc32-target (not darwinppc-target))
     487#+32-bit-target
    497488(defun %single-float-sin! (n result)
    498489  (declare (single-float n result))
    499   (ppc32::with-stack-short-floats ((temp))
     490  (with-stack-short-floats ((temp))
    500491    (%setf-short-float TEMP (#_sinf n))
    501492    (%sf-check-exception-1 'sin n (%ffi-exception-status))
    502493    (%setf-short-float result TEMP)))
    503494
    504 #+(and ppc32-target darwinppc-target)
    505 (defun %single-float-sin! (n result)
    506   (declare (single-float n result))
    507   (with-stack-double-floats ((n2 n)
    508                              (result2))
    509     (%double-float-sin! n2 result2)
    510     (%double-float->short-float result2 result)))
    511 
    512495#+64-bit-target
    513496(defun %single-float-sin (n)
     
    524507    (%setf-double-float result TEMP)))
    525508
    526 #+(and ppc32-target (not darwinppc-target))
     509#+32-bit-target
    527510(defun %single-float-cos! (n result)
    528511  (declare (single-float n result))
    529   (ppc32::with-stack-short-floats ((temp))
     512  (with-stack-short-floats ((temp))
    530513    (%setf-short-float TEMP (#_cosf n))
    531514    (%sf-check-exception-1 'cos n (%ffi-exception-status))
    532515    (%setf-short-float result TEMP)))
    533516
    534 #+(and ppc32-target darwinppc-target)
    535 (defun %single-float-cos! (n result)
    536   (declare (single-float n result))
    537   (with-stack-double-floats ((n2 n)
    538                              (result2))
    539     (%double-float-cos! n2 result2)
    540     (%double-float->short-float result2 result)))
    541 
    542517#+64-bit-target
    543518(defun %single-float-cos (n)
     
    554529    (%setf-double-float result TEMP)))
    555530
    556 #+(and ppc32-target (not darwinppc-target))
     531#+32-bit-target
    557532(defun %single-float-acos! (n result)
    558533  (declare (single-float n result))
    559   (ppc32::with-stack-short-floats ((temp))
     534  (with-stack-short-floats ((temp))
    560535    (%setf-short-float TEMP (#_acosf n))
    561536    (%sf-check-exception-1 'acos n (%ffi-exception-status))
    562537    (%setf-short-float result TEMP)))
    563538
    564 #+(and ppc32-target darwinppc-target)
    565 (defun %single-float-acos! (n result)
    566   (declare (single-float n result))
    567   (with-stack-double-floats ((n2 n)
    568                              (result2))
    569     (%double-float-acos! n2 result2)
    570     (%double-float->short-float result2 result)))
    571 
    572539#+64-bit-target
    573540(defun %single-float-acos (n)
     
    584551    (%setf-double-float result TEMP)))
    585552
    586 #+(and ppc32-target (not darwinppc-target))
     553#+32-bit-target
    587554(defun %single-float-asin! (n result)
    588555  (declare (single-float n result))
    589   (ppc32::with-stack-short-floats ((temp))
     556  (with-stack-short-floats ((temp))
    590557    (%setf-short-float TEMP (#_asinf n))
    591558    (%sf-check-exception-1 'asin n (%ffi-exception-status))
    592559    (%setf-short-float result TEMP)))
    593560
    594 #+(and ppc32-target darwinppc-target)
    595 (defun %single-float-asin! (n result)
    596   (declare (single-float n result))
    597   (with-stack-double-floats ((n2 n)
    598                              (result2))
    599     (%double-float-asin! n2 result2)
    600     (%double-float->short-float result2 result)))
    601 
    602561#+64-bit-target
    603562(defun %single-float-asin (n)
     
    614573    (%setf-double-float result TEMP)))
    615574
    616 #+(and ppc32-target (not darwinppc-target))
     575#+32-bit-target
    617576(defun %single-float-cosh! (n result)
    618577  (declare (single-float n result))
    619   (ppc32::with-stack-short-floats ((temp))
     578  (with-stack-short-floats ((temp))
    620579    (%setf-short-float TEMP (#_coshf n))
    621580    (%sf-check-exception-1 'cosh n (%ffi-exception-status))
    622581    (%setf-short-float result TEMP)))
    623582
    624 #+(and ppc32-target darwinppc-target)
    625 (defun %single-float-cosh! (n result)
    626   (declare (single-float n result))
    627   (with-stack-double-floats ((n2 n)
    628                              (result2))
    629     (%double-float-cosh! n2 result2)
    630     (%double-float->short-float result2 result)))
    631 
    632583#+64-bit-target
    633584(defun %single-float-cosh (n)
     
    637588    result))
    638589
    639 
    640590(defun %double-float-log! (n result)
    641591  (declare (double-float n result))
     
    645595    (%setf-double-float result TEMP)))
    646596
    647 #+ppc32-target
    648 (progn
    649 #-darwinppc-target
     597#+32-bit-target
    650598(defun %single-float-log! (n result)
    651599  (declare (single-float n result))
    652   (ppc32::with-stack-short-floats ((temp))
     600  (with-stack-short-floats ((temp))
    653601    (%setf-short-float TEMP (#_logf n))
    654602    (%sf-check-exception-1 'log n (%ffi-exception-status))
    655603    (%setf-short-float result TEMP)))
    656 
    657 #+darwinppc-target
    658 (defun %single-float-log! (n result)
    659   (declare (single-float n result))
    660   (with-stack-double-floats ((n2 n)
    661                              (result2))
    662     (%double-float-log! n2 result2)
    663     (%double-float->short-float result2 result)))
    664 )
    665604
    666605#+64-bit-target
     
    677616    (%setf-double-float result TEMP)))
    678617
    679 #+(and ppc32-target (not darwinppc-target))
     618#+32-bit-target
    680619(defun %single-float-tan! (n result)
    681620  (declare (single-float n result))
    682   (ppc32::with-stack-short-floats ((temp))
     621  (with-stack-short-floats ((temp))
    683622    (%setf-short-float TEMP (#_tanf n))
    684623    (%sf-check-exception-1 'tan n (%ffi-exception-status))
    685624    (%setf-short-float result TEMP)))
    686625
    687 #+(and ppc32-target darwinppc-target)
    688 (defun %single-float-tan! (n result)
    689   (declare (single-float n result))
    690   (with-stack-double-floats ((n2 n)
    691                              (result2))
    692     (%double-float-tan! n2 result2)
    693     (%double-float->short-float result2 result)))
    694 
    695626#+64-bit-target
    696627(defun %single-float-tan (n)
     
    708639
    709640
    710 #+(and ppc32-target (not darwinppc-target))
     641#+32-bit-target
    711642(defun %single-float-atan! (n result)
    712643  (declare (single-float n result))
    713   (ppc32::with-stack-short-floats ((temp))
     644  (with-stack-short-floats ((temp))
    714645    (%setf-short-float TEMP (#_atanf n))
    715646    (%sf-check-exception-1 'atan n (%ffi-exception-status))
    716647    (%setf-short-float result TEMP)))
    717 
    718 #+(and ppc32-target darwinppc-target)
    719 (defun %single-float-atan! (n result)
    720   (declare (single-float n result))
    721   (with-stack-double-floats ((n2 n)
    722                              (result2))
    723     (%double-float-atan! n2 result2)
    724     (%double-float->short-float result2 result)))
    725648
    726649#+64-bit-target
     
    738661    (%setf-double-float result TEMP)))
    739662
    740 #+(and ppc32-target (not darwinppc-target))
     663#+32-bit-target
    741664(defun %single-float-atan2! (x y result)
    742665  (declare (single-float x y result))
    743   (ppc32::with-stack-short-floats ((temp))
     666  (with-stack-short-floats ((temp))
    744667    (%setf-short-float TEMP (#_atan2f x y))
    745668    (%sf-check-exception-2 'atan2 x y (%ffi-exception-status))
    746669    (%setf-short-float result TEMP)))
    747 
    748 #+(and ppc32-target darwinppc-target)
    749 (defun %single-float-atan2! (x y result)
    750   (declare (single-float x y result))
    751   (with-stack-double-floats ((x2 x)
    752                              (y2 y)
    753                              (result2))
    754     (%double-float-atan2! x2 y2 result2)
    755     (%double-float->short-float result2 result)))
    756670
    757671#+64-bit-target
     
    769683    (%setf-double-float result TEMP)))
    770684
    771 #+(and ppc32-target (not darwinppc-target))
     685#+32-bit-target
    772686(defun %single-float-exp! (n result)
    773687  (declare (single-float n result))
    774   (ppc32::with-stack-short-floats ((temp))
     688  (with-stack-short-floats ((temp))
    775689    (%setf-short-float TEMP (#_expf n))
    776690    (%sf-check-exception-1 'exp n (%ffi-exception-status))
    777691    (%setf-short-float result TEMP)))
    778692
    779 #+(and ppc32-target darwinppc-target)
    780 (defun %single-float-exp! (n result)
    781   (declare (single-float n result))
    782   (with-stack-double-floats ((n2 n)
    783                              (result2))
    784     (%double-float-exp! n2 result2)
    785     (%double-float->short-float result2 result)))
    786 
    787693#+64-bit-target
    788694(defun %single-float-exp (n)
     
    799705    (%setf-double-float result TEMP)))
    800706
    801 #+(and ppc32-target (not darwinppc-target))
     707#+32-bit-target
    802708(defun %single-float-sinh! (n result)
    803709  (declare (single-float n result))
    804   (ppc32::with-stack-short-floats ((temp))
     710  (with-stack-short-floats ((temp))
    805711    (%setf-short-float TEMP (#_sinhf n))
    806712    (%sf-check-exception-1 'sinh n (%ffi-exception-status))
    807713    (%setf-short-float result TEMP)))
    808714
    809 #+(and darwinppc-target ppc32-target)
    810 (defun %single-float-sinh! (n result)
    811   (declare (single-float n result))
    812   (with-stack-double-floats ((n2 n)
    813                              (result2))
    814     (%double-float-sinh! n2 result2)
    815     (%double-float->short-float result2 result)))
    816 
    817715#+64-bit-target
    818716(defun %single-float-sinh (n)
     
    822720    result))
    823721
    824 
    825 
    826722(defun %double-float-tanh! (n result)
    827723  (declare (double-float n result))
     
    831727    (%setf-double-float result TEMP)))
    832728
    833 
    834 #+(and ppc32-target (not darwinppc-target))
     729#+32-bit-target
    835730(defun %single-float-tanh! (n result)
    836731  (declare (single-float n result))
    837   (ppc32::with-stack-short-floats ((temp))
     732  (with-stack-short-floats ((temp))
    838733    (%setf-short-float TEMP (#_tanhf n))
    839734    (%sf-check-exception-1 'tanh n (%ffi-exception-status))
    840735    (%setf-short-float result TEMP)))
    841736
    842 #+(and ppc32-target darwinppc-target)
    843 (defun %single-float-tanh! (n result)
    844   (declare (single-float n result))
    845   (with-stack-double-floats ((n2 n)
    846                              (result2))
    847     (%double-float-tanh! n2 result2)
    848     (%double-float->short-float result2 result)))
    849 
    850737#+64-bit-target
    851738(defun %single-float-tanh (n)
     
    863750
    864751
    865 #+(and ppc32-target (not darwinppc-target))
     752#+32-bit-target
    866753(defun %single-float-asinh! (n result)
    867754  (declare (single-float n result))
    868   (ppc32::with-stack-short-floats ((temp))
     755  (with-stack-short-floats ((temp))
    869756    (%setf-short-float TEMP (#_asinhf n))
    870757    (%sf-check-exception-1 'asinh n (%ffi-exception-status))
    871758    (%setf-short-float result TEMP)))
    872759
    873 #+(and ppc32-target darwinppc-target)
    874 (defun %single-float-asinh! (n result)
    875   (declare (single-float n result))
    876   (with-stack-double-floats ((n2 n)
    877                              (result2))
    878     (%double-float-asinh! n2 result2)
    879     (%double-float->short-float result2 result)))
    880 
    881760#+64-bit-target
    882761(defun %single-float-asinh (n)
     
    893772    (%setf-double-float result TEMP)))
    894773
    895 #+(and ppc32-target (not darwinppc-target))
     774#+32-bit-target
    896775(defun %single-float-acosh! (n result)
    897776  (declare (single-float n result))
    898   (ppc32::with-stack-short-floats ((temp))
     777  (with-stack-short-floats ((temp))
    899778    (%setf-short-float TEMP (#_acoshf n))
    900779    (%sf-check-exception-1 'acosh n (%ffi-exception-status))
    901780    (%setf-short-float result TEMP)))
    902781
    903 #+(and ppc32-target darwinppc-target)
    904 (defun %single-float-acosh! (n result)
    905   (declare (single-float n result))
    906   (with-stack-double-floats ((n2 n)
    907                              (result2))
    908     (%double-float-acosh! n2 result2)
    909     (%double-float->short-float result2 result)))
    910 
    911782#+64-bit-target
    912783(defun %single-float-acosh (n)
     
    923794    (%setf-double-float result TEMP)))
    924795
    925 #+(and ppc32-target (not darwinppc-target))
     796#+32-bit-target
    926797(defun %single-float-atanh! (n result)
    927798  (declare (single-float n result))
    928   (ppc32::with-stack-short-floats ((temp))
     799  (with-stack-short-floats ((temp))
    929800    (%setf-short-float TEMP (#_atanhf n))
    930801    (%sf-check-exception-1 'atanh n (%ffi-exception-status))
    931802    (%setf-short-float result TEMP)))
    932 
    933 #+(and ppc32-target darwinppc-target)
    934 (defun %single-float-atanh! (n result)
    935   (declare (single-float n result))
    936   (with-stack-double-floats ((n2 n)
    937                              (result2))
    938     (%double-float-atanh! n2 result2)
    939     (%double-float->short-float result2 result)))
    940803
    941804#+64-bit-target
  • branches/ia32/lib/number-macros.lisp

    r3605 r7811  
    3939(declare-arch-specific-macro %imagpart)
    4040
     41(defmacro with-stack-short-floats (specs &body body)
     42  (collect ((binds)
     43            (inits)
     44            (names))
     45    (dolist (spec specs)
     46      (let ((name (first spec)))
     47        (binds `(,name (%make-sfloat)))
     48        (names name)
     49        (let ((init (second spec)))
     50          (when init
     51            (inits `(%short-float ,init ,name))))))
     52    `(let* ,(binds)
     53       (declare (dynamic-extent ,@(names))
     54                (short-float ,@(names)))
     55       ,@(inits)
     56       ,@body)))
    4157
    4258(defmacro with-stack-double-floats (specs &body body)
  • branches/ia32/lib/numbers.lisp

    r6012 r7811  
    687687      (%double-float-sinh! x (%make-dfloat))
    688688      #+32-bit-target
    689       (ppc32::with-stack-short-floats ((sx x))
     689      (with-stack-short-floats ((sx x))
    690690        (%single-float-sinh! sx (%make-sfloat)))
    691691      #+64-bit-target
     
    700700      (%double-float-cosh! x (%make-dfloat))
    701701      #+32-bit-target
    702       (ppc32::with-stack-short-floats ((sx x))
     702      (with-stack-short-floats ((sx x))
    703703        (%single-float-cosh! sx (%make-sfloat)))
    704704      #+64-bit-target
     
    712712      (%double-float-tanh! x (%make-dfloat))
    713713      #+32-bit-target
    714       (ppc32::with-stack-short-floats ((sx x))
     714      (with-stack-short-floats ((sx x))
    715715        (%single-float-tanh! sx (%make-sfloat)))
    716716      #+64-bit-target
     
    724724      (%double-float-asinh! x (%make-dfloat))
    725725      #+32-bit-target
    726       (ppc32::with-stack-short-floats ((sx x))
     726      (with-stack-short-floats ((sx x))
    727727        (%single-float-asinh! sx (%make-sfloat)))
    728728      #+64-bit-target
     
    735735      (%double-float-acosh! x (%make-dfloat))
    736736      #+32-bit-target
    737       (ppc32::with-stack-short-floats ((sx x))
     737      (with-stack-short-floats ((sx x))
    738738        (%single-float-acosh! sx (%make-sfloat)))
    739739      #+64-bit-target
Note: See TracChangeset for help on using the changeset viewer.