[cmucl-commit] [git] CMU Common Lisp branch master updated. snapshot-2014-01-5-g7b313ca

Raymond Toy rtoy at common-lisp.net
Tue Jan 7 06:31:15 UTC 2014


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMU Common Lisp".

The branch, master has been updated
       via  7b313ca19a6452137c86f9da65430b946be419a5 (commit)
      from  c4aaa9099d992a0b2cec538a503f87a4e86e0663 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 7b313ca19a6452137c86f9da65430b946be419a5
Author: Raymond Toy <toy.raymond at gmail.com>
Date:   Mon Jan 6 22:31:00 2014 -0800

    Fix complex multiply vop.
    
    Under some conditions (see trac.65 in tests/trac.lisp) r is packed
    into the same location as either x or y, and we were overwriting x (or
    y) with the result before we had finished with the values in x (or y).
    
    With this, trac.65 passes on sparc now.

diff --git a/src/compiler/sparc/float.lisp b/src/compiler/sparc/float.lisp
index e5d654d..013f184 100644
--- a/src/compiler/sparc/float.lisp
+++ b/src/compiler/sparc/float.lisp
@@ -2134,7 +2134,7 @@
 
 ;; Multiply two complex numbers
 (macrolet
-    ((frob (size fmul fadd fsub cost)
+    ((frob (size fmul fadd fsub mov cost)
        (let ((vop-name (symbolicate "*/COMPLEX-" size "-FLOAT"))
 	     (complex-reg (symbolicate "COMPLEX-" size "-REG"))
 	     (real-reg (symbolicate size "-REG"))
@@ -2158,30 +2158,20 @@
 		    (yi (,imag-part y))
 		    (rr (,real-part r))
 		    (ri (,imag-part r)))
-		(cond ((location= r x)
-		       (inst ,fmul p1 xr yr)
-		       (inst ,fmul p2 xr yi)
-		       (inst ,fmul rr xi yi)
-		       (inst ,fsub rr p1 xr)
-		       (inst ,fmul p1 xi yr)
-		       (inst ,fadd ri p2 p1))
-		      ((location= r y)
-		       (inst ,fmul p1 yr xr)
-		       (inst ,fmul p2 yr xi)
-		       (inst ,fmul rr yi xi)
-		       (inst ,fsub rr p1 rr)
-		       (inst ,fmul p1 yi xr)
-		       (inst ,fadd ri p2 p1))
-		      (t
-		       (inst ,fmul rr yr xr)
-		       (inst ,fmul ri xi yi)
-		       (inst ,fsub rr rr ri)
-		       (inst ,fmul p1 xr yi)
-		       (inst ,fmul ri xi yr)
-		       (inst ,fadd ri ri p1)))))))))
-
-  (frob single fmuls fadds fsubs 6)
-  (frob double fmuld faddd fsubd 6))
+		;; Be careful because r might be packed into the same
+		;; location as either x or y.  We have to be careful
+		;; not to modify either x or y until all uses of x or
+		;; y.
+		(inst ,fmul p1 yr xr)	; p1 = xr*yr
+		(inst ,fmul p2 xi yi)	; p2 = xi*yi
+		(inst ,fsub p2 p1 p2)	; p2 = xr*yr - xi*yi
+		(inst ,fmul p1 xr yi)	; p1 = xr*yi
+		(inst ,fmul ri xi yr)	; ri = xi*yr
+		(inst ,fadd ri ri p1)	; ri = xi*yr + xr*yi
+		(, at mov rr p2)))))))
+
+  (frob single fmuls fadds fsubs (inst fmovs) 6)
+  (frob double fmuld faddd fsubd (move-double-reg) 6))
 
 ;; Multiply a complex by a float.  The case of float * complex is
 ;; handled by a deftransform to convert it to the complex*float case.

-----------------------------------------------------------------------

Summary of changes:
 src/compiler/sparc/float.lisp |   40 +++++++++++++++-------------------------
 1 file changed, 15 insertions(+), 25 deletions(-)


hooks/post-receive
-- 
CMU Common Lisp


More information about the cmucl-commit mailing list