From 043a8820506178134574627c2d7f07dc79070bd8 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Fri, 15 Aug 2003 18:07:07 +0000 Subject: [PATCH] 0.8.2.30: 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 | 4 ++++ src/compiler/ppc/float.lisp | 18 ++++++++++++------ src/compiler/srctran.lisp | 4 ++-- tests/float.impure.lisp | 8 ++++++++ version.lisp-expr | 2 +- 5 files changed, 27 insertions(+), 9 deletions(-) diff --git a/OPTIMIZATIONS b/OPTIMIZATIONS index 3c3edea..2806884 100644 --- a/OPTIMIZATIONS +++ b/OPTIMIZATIONS @@ -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) diff --git a/src/compiler/ppc/float.lisp b/src/compiler/ppc/float.lisp index 0a6c97b..ed7bdaa 100644 --- a/src/compiler/ppc/float.lisp +++ b/src/compiler/ppc/float.lisp @@ -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") ;;;; Move functions: @@ -125,7 +131,7 @@ :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) diff --git a/src/compiler/srctran.lisp b/src/compiler/srctran.lisp index 531f97b..355ef96 100644 --- a/src/compiler/srctran.lisp +++ b/src/compiler/srctran.lisp @@ -3385,7 +3385,7 @@ ((< 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. @@ -3394,7 +3394,7 @@ ;; 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)) diff --git a/tests/float.impure.lisp b/tests/float.impure.lisp index ef7379e..f9b8f0d 100644 --- a/tests/float.impure.lisp +++ b/tests/float.impure.lisp @@ -54,5 +54,13 @@ #(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) diff --git a/version.lisp-expr b/version.lisp-expr index 9ecc77c..25933ea 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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" -- 1.7.10.4