From dfee6bab9f173315f7bd0d9e5ed4d696404a39ff Mon Sep 17 00:00:00 2001 From: dtc <dtc> Date: Sun, 2 Apr 2000 18:45:09 +0000 Subject: [PATCH] From Raymond Toy: o Add support for complex FP vops, enabled by the feature :complex-fp-vop which should work for all Sparcs. --- compiler/float-tran.lisp | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/compiler/float-tran.lisp b/compiler/float-tran.lisp index b7ce16baa..d16b98564 100644 --- a/compiler/float-tran.lisp +++ b/compiler/float-tran.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.80 1999/09/06 15:27:45 dtc Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.81 2000/04/02 18:45:09 dtc Exp $") ;;; ;;; ********************************************************************** ;;; @@ -1225,8 +1225,9 @@ ;;; Define some transforms for complex operations. We do this in lieu -;;; of complex operation VOPs. +;;; of complex operation VOPs. Some architectures have vops, though. ;;; +#-complex-fp-vops (macrolet ((frob (type) `(progn ;; Negation @@ -1299,6 +1300,23 @@ (frob single-float) (frob double-float)) +#+complex-fp-vops +(macrolet + ((frob (type) + `(progn + ;; Cis. + (deftransform cis ((z) ((,type)) *) + '(complex (cos z) (sin z))) + ;; Comparison + (deftransform = ((w z) ((complex ,type) real) *) + '(and (= (realpart w) z) (zerop (imagpart w)))) + (deftransform = ((w z) (real (complex ,type)) *) + '(and (= (realpart z) w) (zerop (imagpart z)))) + ))) + + (frob single-float) + (frob double-float)) + ;;; Here are simple optimizers for sin, cos, and tan. They do not ;;; produce a minimal range for the result; the result is the widest ;;; possible answer. This gets around the problem of doing range -- GitLab