Skip to content
Snippets Groups Projects
Commit 3552f0f8 authored by dtc's avatar dtc
Browse files

Restrict the expt->%pow transform to arguments that produce real

results.
parent 918ab253
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.37 1997/09/20 11:51:08 dtc Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.38 1997/10/08 19:41:16 dtc Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -461,16 +461,26 @@ ...@@ -461,16 +461,26 @@
`(,prim x))) `(,prim x)))
`(,prim x))))) `(,prim x)))))
(dolist (stuff '((expt %pow t) (deftransform atan ((x y) (single-float single-float) *)
(atan %atan2 t))) `(coerce (%atan2 (coerce x 'double-float) (coerce y 'double-float))
(destructuring-bind (name prim rtype) stuff 'single-float))
(deftransform name ((x y) '(single-float single-float) rtype :eval-name t) (deftransform atan ((x y) (double-float double-float) * :when :both)
`(coerce (,prim (coerce x 'double-float) `(%atan2 x y))
(coerce y 'double-float))
'single-float)) (deftransform expt ((x y) ((single-float 0f0) single-float) *)
(deftransform name ((x y) '(double-float double-float) "convert to inline float expt"
rtype :eval-name t :when :both) `(coerce (%pow (coerce x 'double-float) (coerce y 'double-float))
`(,prim x y)))) 'single-float))
(deftransform expt ((x y) ((double-float 0d0) double-float) * :when :both)
"convert to inline float expt"
`(%pow x y))
(deftransform expt ((x y) ((single-float 0f0) (signed-byte 32)) *)
"convert to inline float expt"
`(coerce (%pow (coerce x 'double-float) (coerce y 'double-float))
'single-float))
(deftransform expt ((x y) ((double-float 0d0) (signed-byte 32)) * :when :both)
"convert to inline float expt"
`(%pow x (coerce y 'double-float)))
;;; ANSI says log with base zero returns zero. ;;; ANSI says log with base zero returns zero.
(deftransform log ((x y) (float float) float) (deftransform log ((x y) (float float) float)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment