Ignore:
Timestamp:
Jul 19, 2008, 4:23:58 AM (11 years ago)
Author:
rme
Message:

Conditionalize on 32-bit-target instead of ppc32.

We have single-precision trig and transcendentals in the math library
on Darwin now, and have since Panther (10.3). We don't claim to run
on 10.2 any more, so rip out the darwinppc-specific functions that
call the double-precision math library and coerce the results back to
single-float.

File:
1 edited

Legend:

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

    r8535 r10130  
    474474    (%setf-double-float result TEMP)))
    475475
    476 #+(and ppc32-target (not darwinppc-target))
     476#+32-bit-target
    477477(defun %single-float-expt! (b e result)
    478478  (declare (single-float b e result))
    479   (ppc32::with-stack-short-floats ((temp))
     479  (target::with-stack-short-floats ((temp))
    480480    (%setf-short-float temp (#_powf b e))
    481481    (%sf-check-exception-2 'expt b e (%ffi-exception-status))
    482482    (%setf-short-float result TEMP)))
    483 
    484 #+(and ppc32-target darwinppc-target)
    485 (defun %single-float-expt! (b e result)
    486   (declare (single-float b e result))
    487   (with-stack-double-floats ((b2 b)
    488                              (e2 e)
    489                              (result2))
    490     (%double-float-expt! b2 e2 result2)
    491     (%double-float->short-float result2 result)))
    492483
    493484#+64-bit-target
     
    505496    (%setf-double-float result TEMP)))
    506497
    507 #+(and ppc32-target (not darwinppc-target))
     498#+32-bit-target
    508499(defun %single-float-sin! (n result)
    509500  (declare (single-float n result))
    510   (ppc32::with-stack-short-floats ((temp))
     501  (target::with-stack-short-floats ((temp))
    511502    (%setf-short-float TEMP (#_sinf n))
    512503    (%sf-check-exception-1 'sin n (%ffi-exception-status))
    513504    (%setf-short-float result TEMP)))
    514505
    515 #+(and ppc32-target darwinppc-target)
    516 (defun %single-float-sin! (n result)
    517   (declare (single-float n result))
    518   (with-stack-double-floats ((n2 n)
    519                              (result2))
    520     (%double-float-sin! n2 result2)
    521     (%double-float->short-float result2 result)))
    522 
    523506#+64-bit-target
    524507(defun %single-float-sin (n)
     
    535518    (%setf-double-float result TEMP)))
    536519
    537 #+(and ppc32-target (not darwinppc-target))
     520#+32-bit-target
    538521(defun %single-float-cos! (n result)
    539522  (declare (single-float n result))
    540   (ppc32::with-stack-short-floats ((temp))
     523  (target::with-stack-short-floats ((temp))
    541524    (%setf-short-float TEMP (#_cosf n))
    542525    (%sf-check-exception-1 'cos n (%ffi-exception-status))
    543526    (%setf-short-float result TEMP)))
    544527
    545 #+(and ppc32-target darwinppc-target)
    546 (defun %single-float-cos! (n result)
    547   (declare (single-float n result))
    548   (with-stack-double-floats ((n2 n)
    549                              (result2))
    550     (%double-float-cos! n2 result2)
    551     (%double-float->short-float result2 result)))
    552 
    553528#+64-bit-target
    554529(defun %single-float-cos (n)
     
    565540    (%setf-double-float result TEMP)))
    566541
    567 #+(and ppc32-target (not darwinppc-target))
     542#+32-bit-target
    568543(defun %single-float-acos! (n result)
    569544  (declare (single-float n result))
    570   (ppc32::with-stack-short-floats ((temp))
     545  (target::with-stack-short-floats ((temp))
    571546    (%setf-short-float TEMP (#_acosf n))
    572547    (%sf-check-exception-1 'acos n (%ffi-exception-status))
    573548    (%setf-short-float result TEMP)))
    574549
    575 #+(and ppc32-target darwinppc-target)
    576 (defun %single-float-acos! (n result)
    577   (declare (single-float n result))
    578   (with-stack-double-floats ((n2 n)
    579                              (result2))
    580     (%double-float-acos! n2 result2)
    581     (%double-float->short-float result2 result)))
    582 
    583550#+64-bit-target
    584551(defun %single-float-acos (n)
     
    595562    (%setf-double-float result TEMP)))
    596563
    597 #+(and ppc32-target (not darwinppc-target))
     564#+32-bit-target
    598565(defun %single-float-asin! (n result)
    599566  (declare (single-float n result))
    600   (ppc32::with-stack-short-floats ((temp))
     567  (target::with-stack-short-floats ((temp))
    601568    (%setf-short-float TEMP (#_asinf n))
    602569    (%sf-check-exception-1 'asin n (%ffi-exception-status))
    603570    (%setf-short-float result TEMP)))
    604571
    605 #+(and ppc32-target darwinppc-target)
    606 (defun %single-float-asin! (n result)
    607   (declare (single-float n result))
    608   (with-stack-double-floats ((n2 n)
    609                              (result2))
    610     (%double-float-asin! n2 result2)
    611     (%double-float->short-float result2 result)))
    612 
    613572#+64-bit-target
    614573(defun %single-float-asin (n)
     
    625584    (%setf-double-float result TEMP)))
    626585
    627 #+(and ppc32-target (not darwinppc-target))
     586#+32-bit-target
    628587(defun %single-float-cosh! (n result)
    629588  (declare (single-float n result))
    630   (ppc32::with-stack-short-floats ((temp))
     589  (target::with-stack-short-floats ((temp))
    631590    (%setf-short-float TEMP (#_coshf n))
    632591    (%sf-check-exception-1 'cosh n (%ffi-exception-status))
    633592    (%setf-short-float result TEMP)))
    634593
    635 #+(and ppc32-target darwinppc-target)
    636 (defun %single-float-cosh! (n result)
    637   (declare (single-float n result))
    638   (with-stack-double-floats ((n2 n)
    639                              (result2))
    640     (%double-float-cosh! n2 result2)
    641     (%double-float->short-float result2 result)))
    642 
    643594#+64-bit-target
    644595(defun %single-float-cosh (n)
     
    648599    result))
    649600
    650 
    651601(defun %double-float-log! (n result)
    652602  (declare (double-float n result))
     
    656606    (%setf-double-float result TEMP)))
    657607
    658 #+ppc32-target
    659 (progn
    660 #-darwinppc-target
     608#+32-bit-target
    661609(defun %single-float-log! (n result)
    662610  (declare (single-float n result))
    663   (ppc32::with-stack-short-floats ((temp))
     611  (target::with-stack-short-floats ((temp))
    664612    (%setf-short-float TEMP (#_logf n))
    665613    (%sf-check-exception-1 'log n (%ffi-exception-status))
    666614    (%setf-short-float result TEMP)))
    667 
    668 #+darwinppc-target
    669 (defun %single-float-log! (n result)
    670   (declare (single-float n result))
    671   (with-stack-double-floats ((n2 n)
    672                              (result2))
    673     (%double-float-log! n2 result2)
    674     (%double-float->short-float result2 result)))
    675 )
    676615
    677616#+64-bit-target
     
    688627    (%setf-double-float result TEMP)))
    689628
    690 #+(and ppc32-target (not darwinppc-target))
     629#+32-bit-target
    691630(defun %single-float-tan! (n result)
    692631  (declare (single-float n result))
    693   (ppc32::with-stack-short-floats ((temp))
     632  (target::with-stack-short-floats ((temp))
    694633    (%setf-short-float TEMP (#_tanf n))
    695634    (%sf-check-exception-1 'tan n (%ffi-exception-status))
    696635    (%setf-short-float result TEMP)))
    697636
    698 #+(and ppc32-target darwinppc-target)
    699 (defun %single-float-tan! (n result)
    700   (declare (single-float n result))
    701   (with-stack-double-floats ((n2 n)
    702                              (result2))
    703     (%double-float-tan! n2 result2)
    704     (%double-float->short-float result2 result)))
    705 
    706637#+64-bit-target
    707638(defun %single-float-tan (n)
     
    719650
    720651
    721 #+(and ppc32-target (not darwinppc-target))
     652#+32-bit-target
    722653(defun %single-float-atan! (n result)
    723654  (declare (single-float n result))
    724   (ppc32::with-stack-short-floats ((temp))
     655  (target::with-stack-short-floats ((temp))
    725656    (%setf-short-float TEMP (#_atanf n))
    726657    (%sf-check-exception-1 'atan n (%ffi-exception-status))
    727658    (%setf-short-float result TEMP)))
    728 
    729 #+(and ppc32-target darwinppc-target)
    730 (defun %single-float-atan! (n result)
    731   (declare (single-float n result))
    732   (with-stack-double-floats ((n2 n)
    733                              (result2))
    734     (%double-float-atan! n2 result2)
    735     (%double-float->short-float result2 result)))
    736659
    737660#+64-bit-target
     
    749672    (%setf-double-float result TEMP)))
    750673
    751 #+(and ppc32-target (not darwinppc-target))
     674#+32-bit-target
    752675(defun %single-float-atan2! (x y result)
    753676  (declare (single-float x y result))
    754   (ppc32::with-stack-short-floats ((temp))
     677  (target::with-stack-short-floats ((temp))
    755678    (%setf-short-float TEMP (#_atan2f x y))
    756679    (%sf-check-exception-2 'atan2 x y (%ffi-exception-status))
    757680    (%setf-short-float result TEMP)))
    758 
    759 #+(and ppc32-target darwinppc-target)
    760 (defun %single-float-atan2! (x y result)
    761   (declare (single-float x y result))
    762   (with-stack-double-floats ((x2 x)
    763                              (y2 y)
    764                              (result2))
    765     (%double-float-atan2! x2 y2 result2)
    766     (%double-float->short-float result2 result)))
    767681
    768682#+64-bit-target
     
    780694    (%setf-double-float result TEMP)))
    781695
    782 #+(and ppc32-target (not darwinppc-target))
     696#+32-bit-target
    783697(defun %single-float-exp! (n result)
    784698  (declare (single-float n result))
    785   (ppc32::with-stack-short-floats ((temp))
     699  (target::with-stack-short-floats ((temp))
    786700    (%setf-short-float TEMP (#_expf n))
    787701    (%sf-check-exception-1 'exp n (%ffi-exception-status))
    788702    (%setf-short-float result TEMP)))
    789703
    790 #+(and ppc32-target darwinppc-target)
    791 (defun %single-float-exp! (n result)
    792   (declare (single-float n result))
    793   (with-stack-double-floats ((n2 n)
    794                              (result2))
    795     (%double-float-exp! n2 result2)
    796     (%double-float->short-float result2 result)))
    797 
    798704#+64-bit-target
    799705(defun %single-float-exp (n)
     
    810716    (%setf-double-float result TEMP)))
    811717
    812 #+(and ppc32-target (not darwinppc-target))
     718#+32-bit-target
    813719(defun %single-float-sinh! (n result)
    814720  (declare (single-float n result))
    815   (ppc32::with-stack-short-floats ((temp))
     721  (target::with-stack-short-floats ((temp))
    816722    (%setf-short-float TEMP (#_sinhf n))
    817723    (%sf-check-exception-1 'sinh n (%ffi-exception-status))
    818724    (%setf-short-float result TEMP)))
    819725
    820 #+(and darwinppc-target ppc32-target)
    821 (defun %single-float-sinh! (n result)
    822   (declare (single-float n result))
    823   (with-stack-double-floats ((n2 n)
    824                              (result2))
    825     (%double-float-sinh! n2 result2)
    826     (%double-float->short-float result2 result)))
    827 
    828726#+64-bit-target
    829727(defun %single-float-sinh (n)
     
    833731    result))
    834732
    835 
    836 
    837733(defun %double-float-tanh! (n result)
    838734  (declare (double-float n result))
     
    842738    (%setf-double-float result TEMP)))
    843739
    844 
    845 #+(and ppc32-target (not darwinppc-target))
     740#+32-bit-target
    846741(defun %single-float-tanh! (n result)
    847742  (declare (single-float n result))
    848   (ppc32::with-stack-short-floats ((temp))
     743  (target::with-stack-short-floats ((temp))
    849744    (%setf-short-float TEMP (#_tanhf n))
    850745    (%sf-check-exception-1 'tanh n (%ffi-exception-status))
    851746    (%setf-short-float result TEMP)))
    852747
    853 #+(and ppc32-target darwinppc-target)
    854 (defun %single-float-tanh! (n result)
    855   (declare (single-float n result))
    856   (with-stack-double-floats ((n2 n)
    857                              (result2))
    858     (%double-float-tanh! n2 result2)
    859     (%double-float->short-float result2 result)))
    860 
    861748#+64-bit-target
    862749(defun %single-float-tanh (n)
     
    874761
    875762
    876 #+(and ppc32-target (not darwinppc-target))
     763#+32-bit-target
    877764(defun %single-float-asinh! (n result)
    878765  (declare (single-float n result))
    879   (ppc32::with-stack-short-floats ((temp))
     766  (target::with-stack-short-floats ((temp))
    880767    (%setf-short-float TEMP (#_asinhf n))
    881768    (%sf-check-exception-1 'asinh n (%ffi-exception-status))
    882769    (%setf-short-float result TEMP)))
    883770
    884 #+(and ppc32-target darwinppc-target)
    885 (defun %single-float-asinh! (n result)
    886   (declare (single-float n result))
    887   (with-stack-double-floats ((n2 n)
    888                              (result2))
    889     (%double-float-asinh! n2 result2)
    890     (%double-float->short-float result2 result)))
    891 
    892771#+64-bit-target
    893772(defun %single-float-asinh (n)
     
    904783    (%setf-double-float result TEMP)))
    905784
    906 #+(and ppc32-target (not darwinppc-target))
     785#+32-bit-target
    907786(defun %single-float-acosh! (n result)
    908787  (declare (single-float n result))
    909   (ppc32::with-stack-short-floats ((temp))
     788  (target::with-stack-short-floats ((temp))
    910789    (%setf-short-float TEMP (#_acoshf n))
    911790    (%sf-check-exception-1 'acosh n (%ffi-exception-status))
    912791    (%setf-short-float result TEMP)))
    913792
    914 #+(and ppc32-target darwinppc-target)
    915 (defun %single-float-acosh! (n result)
    916   (declare (single-float n result))
    917   (with-stack-double-floats ((n2 n)
    918                              (result2))
    919     (%double-float-acosh! n2 result2)
    920     (%double-float->short-float result2 result)))
    921 
    922793#+64-bit-target
    923794(defun %single-float-acosh (n)
     
    934805    (%setf-double-float result TEMP)))
    935806
    936 #+(and ppc32-target (not darwinppc-target))
     807#+32-bit-target
    937808(defun %single-float-atanh! (n result)
    938809  (declare (single-float n result))
    939   (ppc32::with-stack-short-floats ((temp))
     810  (target::with-stack-short-floats ((temp))
    940811    (%setf-short-float TEMP (#_atanhf n))
    941812    (%sf-check-exception-1 'atanh n (%ffi-exception-status))
    942813    (%setf-short-float result TEMP)))
    943 
    944 #+(and ppc32-target darwinppc-target)
    945 (defun %single-float-atanh! (n result)
    946   (declare (single-float n result))
    947   (with-stack-double-floats ((n2 n)
    948                              (result2))
    949     (%double-float-atanh! n2 result2)
    950     (%double-float->short-float result2 result)))
    951814
    952815#+64-bit-target
Note: See TracChangeset for help on using the changeset viewer.