0.8.2.30:
authorChristophe Rhodes <csr21@cam.ac.uk>
Fri, 15 Aug 2003 18:07:07 +0000 (18:07 +0000)
committerChristophe Rhodes <csr21@cam.ac.uk>
Fri, 15 Aug 2003 18:07:07 +0000 (18:07 +0000)
Fix PPC (complex double-float) bug as reported on sbcl-devel
by Clemens Heitzinger 2003-08-12
... the right way, not as per CSR patch sbcl-devel, but as per
CSR words sbcl-devel;
... also fix error reporting in CERROR format DEFTRANSFORM
(oh, the irony).

OPTIMIZATIONS
src/compiler/ppc/float.lisp
src/compiler/srctran.lisp
tests/float.impure.lisp
version.lisp-expr

index 3c3edea..2806884 100644 (file)
@@ -96,6 +96,10 @@ VOP DATA-VECTOR-SET/SIMPLE-STRING V2!14[EDI] t32[EAX] t30[S2]>t33[CL]
   (if (< x 0) x (foo (1- x))))
 
 SBCL generates a full call of FOO (but CMUCL does not).
+
+Partial explanation: CMUCL does generate a full (tail) call to FOO if
+*BLOCK-COMPILE* is NIL.  Maybe this is because in that case CMUCL doesn't 
+generate a temporary(?) function in its IR1-TRANSLATOR for %DEFUN?
 --------------------------------------------------------------------------------
 #8
 (defun foo (d)
index 0a6c97b..ed7bdaa 100644 (file)
@@ -1,9 +1,15 @@
-2;;;
-;;; Written by Rob MacLachlan
-;;; Sparc conversion by William Lott.
-;;;
-(in-package "SB!VM")
+;;;; floating point support for the PPC
+
+;;;; This software is part of the SBCL system. See the README file for
+;;;; more information.
+;;;;
+;;;; This software is derived from the CMU CL system, which was
+;;;; written at Carnegie Mellon University and released into the
+;;;; public domain. The software is in the public domain and is
+;;;; provided with absolutely no warranty. See the COPYING and CREDITS
+;;;; files for more information.
 
+(in-package "SB!VM")
 \f
 ;;;; Move functions:
 
                  :offset (tn-offset x)))
 (defun complex-double-reg-imag-tn (x)
   (make-random-tn :kind :normal :sc (sc-or-lose 'double-reg)
-                 :offset (+ (tn-offset x) 2)))
+                 :offset (1+ (tn-offset x))))
 
 
 (define-move-fun (load-complex-single 2) (vop x y)
index 531f97b..355ef96 100644 (file)
              ((< nargs (min min1 min2))
               (compiler-warn "Too few arguments (~D) to ~S ~S ~S: ~
                                requires at least ~D."
-                             nargs 'cerror report control min))
+                             nargs 'cerror report control (min min1 min2)))
              ((> nargs (max max1 max2))
               (;; to get warned about probably bogus code at
                ;; cross-compile time.
                ;; run-time error.
                #-sb-xc-host compiler-style-warn
                "Too many arguments (~D) to ~S ~S ~S: uses at most ~D."
-               nargs 'cerror report control max))))))))
+               nargs 'cerror report control (max max1 max2)))))))))
   (give-up-ir1-transform))
 
 (defoptimizer (coerce derive-type) ((value type))
index ef7379e..f9b8f0d 100644 (file)
                  #(2.0d0 2.0d0)
                  #(3.0d0 3.0d0))))
 
+(defun complex-double-float-ppc (x y)
+  (declare (type (complex double-float) x y))
+  (declare (optimize speed))
+  (+ x y))
+(compile 'complex-double-float-ppc)
+(assert (= (complex-double-float-ppc #c(0.0d0 1.0d0) #c(2.0d0 3.0d0))
+           #c(2.0d0 4.0d0)))
+
 ;;; success
 (quit :unix-status 104)
index 9ecc77c..25933ea 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"0.8.2.29"
+"0.8.2.30"