diff --git a/compiler/float-tran.lisp b/compiler/float-tran.lisp index b7ce16baa944e7e9e21d7d7d2c7567a31f225d37..d16b985646cc8faee84c9ad9f2f597fac8d3a0bc 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