Index: /branches/ia32/level-1/l1-numbers.lisp
===================================================================
--- /branches/ia32/level-1/l1-numbers.lisp	(revision 7810)
+++ /branches/ia32/level-1/l1-numbers.lisp	(revision 7811)
@@ -463,20 +463,11 @@
     (%setf-double-float result TEMP)))
 
-#+(and ppc32-target (not darwinppc-target))
+#+32-bit-target
 (defun %single-float-expt! (b e result)
   (declare (single-float b e result))
-  (ppc32::with-stack-short-floats ((temp))
+  (with-stack-short-floats ((temp))
     (%setf-short-float temp (#_powf b e))
     (%sf-check-exception-2 'expt b e (%ffi-exception-status))
     (%setf-short-float result TEMP)))
-
-#+(and ppc32-target darwinppc-target)
-(defun %single-float-expt! (b e result)
-  (declare (single-float b e result))
-  (with-stack-double-floats ((b2 b)
-			     (e2 e)
-			     (result2))
-    (%double-float-expt! b2 e2 result2)
-    (%double-float->short-float result2 result)))
 
 #+64-bit-target
@@ -494,20 +485,12 @@
     (%setf-double-float result TEMP)))
 
-#+(and ppc32-target (not darwinppc-target))
+#+32-bit-target
 (defun %single-float-sin! (n result)
   (declare (single-float n result))
-  (ppc32::with-stack-short-floats ((temp))
+  (with-stack-short-floats ((temp))
     (%setf-short-float TEMP (#_sinf n))
     (%sf-check-exception-1 'sin n (%ffi-exception-status))
     (%setf-short-float result TEMP)))
 
-#+(and ppc32-target darwinppc-target)
-(defun %single-float-sin! (n result)
-  (declare (single-float n result))
-  (with-stack-double-floats ((n2 n)
-			     (result2))
-    (%double-float-sin! n2 result2)
-    (%double-float->short-float result2 result)))
-
 #+64-bit-target
 (defun %single-float-sin (n)
@@ -524,20 +507,12 @@
     (%setf-double-float result TEMP)))
 
-#+(and ppc32-target (not darwinppc-target))
+#+32-bit-target
 (defun %single-float-cos! (n result)
   (declare (single-float n result))
-  (ppc32::with-stack-short-floats ((temp))
+  (with-stack-short-floats ((temp))
     (%setf-short-float TEMP (#_cosf n))
     (%sf-check-exception-1 'cos n (%ffi-exception-status))
     (%setf-short-float result TEMP)))
 
-#+(and ppc32-target darwinppc-target)
-(defun %single-float-cos! (n result)
-  (declare (single-float n result))
-  (with-stack-double-floats ((n2 n)
-			     (result2))
-    (%double-float-cos! n2 result2)
-    (%double-float->short-float result2 result)))
-
 #+64-bit-target
 (defun %single-float-cos (n)
@@ -554,20 +529,12 @@
     (%setf-double-float result TEMP)))
 
-#+(and ppc32-target (not darwinppc-target))
+#+32-bit-target
 (defun %single-float-acos! (n result)
   (declare (single-float n result))
-  (ppc32::with-stack-short-floats ((temp))
+  (with-stack-short-floats ((temp))
     (%setf-short-float TEMP (#_acosf n))
     (%sf-check-exception-1 'acos n (%ffi-exception-status))
     (%setf-short-float result TEMP)))
 
-#+(and ppc32-target darwinppc-target)
-(defun %single-float-acos! (n result)
-  (declare (single-float n result))
-  (with-stack-double-floats ((n2 n)
-			     (result2))
-    (%double-float-acos! n2 result2)
-    (%double-float->short-float result2 result)))
-
 #+64-bit-target
 (defun %single-float-acos (n)
@@ -584,20 +551,12 @@
     (%setf-double-float result TEMP)))
 
-#+(and ppc32-target (not darwinppc-target))
+#+32-bit-target
 (defun %single-float-asin! (n result)
   (declare (single-float n result))
-  (ppc32::with-stack-short-floats ((temp))
+  (with-stack-short-floats ((temp))
     (%setf-short-float TEMP (#_asinf n))
     (%sf-check-exception-1 'asin n (%ffi-exception-status))
     (%setf-short-float result TEMP)))
 
-#+(and ppc32-target darwinppc-target) 
-(defun %single-float-asin! (n result)
-  (declare (single-float n result))
-  (with-stack-double-floats ((n2 n)
-			     (result2))
-    (%double-float-asin! n2 result2)
-    (%double-float->short-float result2 result)))
-
 #+64-bit-target
 (defun %single-float-asin (n)
@@ -614,20 +573,12 @@
     (%setf-double-float result TEMP)))
 
-#+(and ppc32-target (not darwinppc-target))
+#+32-bit-target
 (defun %single-float-cosh! (n result)
   (declare (single-float n result))
-  (ppc32::with-stack-short-floats ((temp))
+  (with-stack-short-floats ((temp))
     (%setf-short-float TEMP (#_coshf n))
     (%sf-check-exception-1 'cosh n (%ffi-exception-status))
     (%setf-short-float result TEMP)))
 
-#+(and ppc32-target darwinppc-target)
-(defun %single-float-cosh! (n result)
-  (declare (single-float n result))
-  (with-stack-double-floats ((n2 n)
-			     (result2))
-    (%double-float-cosh! n2 result2)
-    (%double-float->short-float result2 result)))
-
 #+64-bit-target
 (defun %single-float-cosh (n)
@@ -637,5 +588,4 @@
     result))
 
-
 (defun %double-float-log! (n result)
   (declare (double-float n result))
@@ -645,22 +595,11 @@
     (%setf-double-float result TEMP)))
 
-#+ppc32-target
-(progn
-#-darwinppc-target
+#+32-bit-target
 (defun %single-float-log! (n result)
   (declare (single-float n result))
-  (ppc32::with-stack-short-floats ((temp))
+  (with-stack-short-floats ((temp))
     (%setf-short-float TEMP (#_logf n))
     (%sf-check-exception-1 'log n (%ffi-exception-status))
     (%setf-short-float result TEMP)))
-
-#+darwinppc-target
-(defun %single-float-log! (n result)
-  (declare (single-float n result))
-  (with-stack-double-floats ((n2 n)
-			     (result2))
-    (%double-float-log! n2 result2)
-    (%double-float->short-float result2 result)))
-)
 
 #+64-bit-target
@@ -677,20 +616,12 @@
     (%setf-double-float result TEMP)))
 
-#+(and ppc32-target (not darwinppc-target))
+#+32-bit-target
 (defun %single-float-tan! (n result)
   (declare (single-float n result))
-  (ppc32::with-stack-short-floats ((temp))
+  (with-stack-short-floats ((temp))
     (%setf-short-float TEMP (#_tanf n))
     (%sf-check-exception-1 'tan n (%ffi-exception-status))
     (%setf-short-float result TEMP)))
 
-#+(and ppc32-target darwinppc-target)
-(defun %single-float-tan! (n result)
-  (declare (single-float n result))
-  (with-stack-double-floats ((n2 n)
-			     (result2))
-    (%double-float-tan! n2 result2)
-    (%double-float->short-float result2 result)))
-
 #+64-bit-target
 (defun %single-float-tan (n)
@@ -708,19 +639,11 @@
 
 
-#+(and ppc32-target (not darwinppc-target))
+#+32-bit-target
 (defun %single-float-atan! (n result)
   (declare (single-float n result))
-  (ppc32::with-stack-short-floats ((temp))
+  (with-stack-short-floats ((temp))
     (%setf-short-float TEMP (#_atanf n))
     (%sf-check-exception-1 'atan n (%ffi-exception-status))
     (%setf-short-float result TEMP)))
-
-#+(and ppc32-target darwinppc-target)
-(defun %single-float-atan! (n result)
-  (declare (single-float n result))
-  (with-stack-double-floats ((n2 n)
-			     (result2))
-    (%double-float-atan! n2 result2)
-    (%double-float->short-float result2 result)))
 
 #+64-bit-target
@@ -738,20 +661,11 @@
     (%setf-double-float result TEMP)))
 
-#+(and ppc32-target (not darwinppc-target))
+#+32-bit-target
 (defun %single-float-atan2! (x y result)
   (declare (single-float x y result))
-  (ppc32::with-stack-short-floats ((temp))
+  (with-stack-short-floats ((temp))
     (%setf-short-float TEMP (#_atan2f x y))
     (%sf-check-exception-2 'atan2 x y (%ffi-exception-status))
     (%setf-short-float result TEMP)))
-
-#+(and ppc32-target darwinppc-target)
-(defun %single-float-atan2! (x y result)
-  (declare (single-float x y result))
-  (with-stack-double-floats ((x2 x)
-			     (y2 y)
-			     (result2))
-    (%double-float-atan2! x2 y2 result2)
-    (%double-float->short-float result2 result)))
 
 #+64-bit-target
@@ -769,20 +683,12 @@
     (%setf-double-float result TEMP)))
 
-#+(and ppc32-target (not darwinppc-target))
+#+32-bit-target
 (defun %single-float-exp! (n result)
   (declare (single-float n result))
-  (ppc32::with-stack-short-floats ((temp))
+  (with-stack-short-floats ((temp))
     (%setf-short-float TEMP (#_expf n))
     (%sf-check-exception-1 'exp n (%ffi-exception-status))
     (%setf-short-float result TEMP)))
 
-#+(and ppc32-target darwinppc-target)
-(defun %single-float-exp! (n result)
-  (declare (single-float n result))
-  (with-stack-double-floats ((n2 n)
-			     (result2))
-    (%double-float-exp! n2 result2)
-    (%double-float->short-float result2 result)))
-
 #+64-bit-target
 (defun %single-float-exp (n)
@@ -799,20 +705,12 @@
     (%setf-double-float result TEMP)))
 
-#+(and ppc32-target (not darwinppc-target))
+#+32-bit-target
 (defun %single-float-sinh! (n result)
   (declare (single-float n result))
-  (ppc32::with-stack-short-floats ((temp))
+  (with-stack-short-floats ((temp))
     (%setf-short-float TEMP (#_sinhf n))
     (%sf-check-exception-1 'sinh n (%ffi-exception-status))
     (%setf-short-float result TEMP)))
 
-#+(and darwinppc-target ppc32-target)
-(defun %single-float-sinh! (n result)
-  (declare (single-float n result))
-  (with-stack-double-floats ((n2 n)
-			     (result2))
-    (%double-float-sinh! n2 result2)
-    (%double-float->short-float result2 result)))
-
 #+64-bit-target
 (defun %single-float-sinh (n)
@@ -822,6 +720,4 @@
     result))
 
-
-
 (defun %double-float-tanh! (n result)
   (declare (double-float n result))
@@ -831,21 +727,12 @@
     (%setf-double-float result TEMP)))
 
-
-#+(and ppc32-target (not darwinppc-target))
+#+32-bit-target
 (defun %single-float-tanh! (n result)
   (declare (single-float n result))
-  (ppc32::with-stack-short-floats ((temp))
+  (with-stack-short-floats ((temp))
     (%setf-short-float TEMP (#_tanhf n))
     (%sf-check-exception-1 'tanh n (%ffi-exception-status))
     (%setf-short-float result TEMP)))
 
-#+(and ppc32-target darwinppc-target)
-(defun %single-float-tanh! (n result)
-  (declare (single-float n result))
-  (with-stack-double-floats ((n2 n)
-			     (result2))
-    (%double-float-tanh! n2 result2)
-    (%double-float->short-float result2 result)))
-
 #+64-bit-target
 (defun %single-float-tanh (n)
@@ -863,20 +750,12 @@
 
 
-#+(and ppc32-target (not darwinppc-target))
+#+32-bit-target
 (defun %single-float-asinh! (n result)
   (declare (single-float n result))
-  (ppc32::with-stack-short-floats ((temp))
+  (with-stack-short-floats ((temp))
     (%setf-short-float TEMP (#_asinhf n))
     (%sf-check-exception-1 'asinh n (%ffi-exception-status))
     (%setf-short-float result TEMP)))
 
-#+(and ppc32-target darwinppc-target)
-(defun %single-float-asinh! (n result)
-  (declare (single-float n result))
-  (with-stack-double-floats ((n2 n)
-			     (result2))
-    (%double-float-asinh! n2 result2)
-    (%double-float->short-float result2 result)))
-
 #+64-bit-target
 (defun %single-float-asinh (n)
@@ -893,20 +772,12 @@
     (%setf-double-float result TEMP)))
 
-#+(and ppc32-target (not darwinppc-target))
+#+32-bit-target
 (defun %single-float-acosh! (n result)
   (declare (single-float n result))
-  (ppc32::with-stack-short-floats ((temp))
+  (with-stack-short-floats ((temp))
     (%setf-short-float TEMP (#_acoshf n))
     (%sf-check-exception-1 'acosh n (%ffi-exception-status))
     (%setf-short-float result TEMP)))
 
-#+(and ppc32-target darwinppc-target)
-(defun %single-float-acosh! (n result)
-  (declare (single-float n result))
-  (with-stack-double-floats ((n2 n)
-			     (result2))
-    (%double-float-acosh! n2 result2)
-    (%double-float->short-float result2 result)))
-
 #+64-bit-target
 (defun %single-float-acosh (n)
@@ -923,19 +794,11 @@
     (%setf-double-float result TEMP)))
 
-#+(and ppc32-target (not darwinppc-target))
+#+32-bit-target
 (defun %single-float-atanh! (n result)
   (declare (single-float n result)) 
-  (ppc32::with-stack-short-floats ((temp))
+  (with-stack-short-floats ((temp))
     (%setf-short-float TEMP (#_atanhf n))
     (%sf-check-exception-1 'atanh n (%ffi-exception-status))
     (%setf-short-float result TEMP)))
-
-#+(and ppc32-target darwinppc-target)
-(defun %single-float-atanh! (n result)
-  (declare (single-float n result))
-  (with-stack-double-floats ((n2 n)
-			     (result2))
-    (%double-float-atanh! n2 result2)
-    (%double-float->short-float result2 result)))
 
 #+64-bit-target
Index: /branches/ia32/lib/number-macros.lisp
===================================================================
--- /branches/ia32/lib/number-macros.lisp	(revision 7810)
+++ /branches/ia32/lib/number-macros.lisp	(revision 7811)
@@ -39,4 +39,20 @@
 (declare-arch-specific-macro %imagpart)
 
+(defmacro with-stack-short-floats (specs &body body)
+  (collect ((binds)
+	    (inits)
+	    (names))
+    (dolist (spec specs)
+      (let ((name (first spec)))
+	(binds `(,name (%make-sfloat)))
+	(names name)
+	(let ((init (second spec)))
+	  (when init
+	    (inits `(%short-float ,init ,name))))))
+    `(let* ,(binds)
+       (declare (dynamic-extent ,@(names))
+		(short-float ,@(names)))
+       ,@(inits)
+       ,@body)))
 
 (defmacro with-stack-double-floats (specs &body body)
Index: /branches/ia32/lib/numbers.lisp
===================================================================
--- /branches/ia32/lib/numbers.lisp	(revision 7810)
+++ /branches/ia32/lib/numbers.lisp	(revision 7811)
@@ -687,5 +687,5 @@
       (%double-float-sinh! x (%make-dfloat))
       #+32-bit-target
-      (ppc32::with-stack-short-floats ((sx x))
+      (with-stack-short-floats ((sx x))
 	(%single-float-sinh! sx (%make-sfloat)))
       #+64-bit-target
@@ -700,5 +700,5 @@
       (%double-float-cosh! x (%make-dfloat))
       #+32-bit-target
-      (ppc32::with-stack-short-floats ((sx x))
+      (with-stack-short-floats ((sx x))
 	(%single-float-cosh! sx (%make-sfloat)))
       #+64-bit-target
@@ -712,5 +712,5 @@
       (%double-float-tanh! x (%make-dfloat))
       #+32-bit-target
-      (ppc32::with-stack-short-floats ((sx x))
+      (with-stack-short-floats ((sx x))
 	(%single-float-tanh! sx (%make-sfloat)))
       #+64-bit-target
@@ -724,5 +724,5 @@
       (%double-float-asinh! x (%make-dfloat))
       #+32-bit-target
-      (ppc32::with-stack-short-floats ((sx x))
+      (with-stack-short-floats ((sx x))
 	(%single-float-asinh! sx (%make-sfloat)))
       #+64-bit-target
@@ -735,5 +735,5 @@
       (%double-float-acosh! x (%make-dfloat))
       #+32-bit-target
-      (ppc32::with-stack-short-floats ((sx x))
+      (with-stack-short-floats ((sx x))
 	(%single-float-acosh! sx (%make-sfloat)))
       #+64-bit-target
