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

Modify the deftransforms for %sin, %cos, and %tan, to avoid an x86

conditional in the compile; now uses backend-featurep :x86; should
help cross-compiling.
parent 0ebe95dd
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.28 1997/04/12 18:12:16 dtc Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/float-tran.lisp,v 1.29 1997/04/16 18:16:11 dtc Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -339,11 +339,11 @@ ...@@ -339,11 +339,11 @@
;;;; Irrational transforms: ;;;; Irrational transforms:
(defknown (%tan %sinh %asinh %atanh %log %logb %log10 #+x86 %tan-quick) (defknown (%tan %sinh %asinh %atanh %log %logb %log10 %tan-quick)
(double-float) double-float (double-float) double-float
(movable foldable flushable)) (movable foldable flushable))
(defknown (%sin %cos %tanh #+x86 %sin-quick #+x86 %cos-quick) (defknown (%sin %cos %tanh %sin-quick %cos-quick)
(double-float) (double-float -1.0d0 1.0d0) (double-float) (double-float -1.0d0 1.0d0)
(movable foldable flushable)) (movable foldable flushable))
...@@ -390,9 +390,6 @@ ...@@ -390,9 +390,6 @@
(dolist (stuff '((exp %exp *) (dolist (stuff '((exp %exp *)
(log %log float) (log %log float)
(sqrt %sqrt float) (sqrt %sqrt float)
#-x86 (sin %sin *)
#-x86 (cos %cos *)
#-x86 (tan %tan *)
(asin %asin float) (asin %asin float)
(acos %acos float) (acos %acos float)
(atan %atan *) (atan %atan *)
...@@ -411,33 +408,39 @@ ...@@ -411,33 +408,39 @@
;;; The argument range is limited on the x86 FP trig. functions. A ;;; The argument range is limited on the x86 FP trig. functions. A
;;; post-test can detect a failure (and load a suitable result), but ;;; post-test can detect a failure (and load a suitable result), but
;;; this test is avoided if possible. ;;; this test is avoided if possible.
#+x86
(dolist (stuff '((sin %sin %sin-quick) (dolist (stuff '((sin %sin %sin-quick)
(cos %cos %cos-quick) (cos %cos %cos-quick)
(tan %tan %tan-quick))) (tan %tan %tan-quick)))
(destructuring-bind (name prim prim-quick) stuff (destructuring-bind (name prim prim-quick) stuff
(deftransform name ((x) '(single-float) '* :eval-name t :when :both) (deftransform name ((x) '(single-float) '* :eval-name t)
(cond ((csubtypep (continuation-type x) (if (backend-featurep :x86)
(specifier-type '(single-float (#.(- (expt 2f0 64))) (cond ((csubtypep (continuation-type x)
(#.(expt 2f0 64))))) (specifier-type '(single-float
`(coerce (,prim-quick (coerce x 'double-float)) 'single-float)) (#.(- (expt 2f0 64)))
(t (#.(expt 2f0 64)))))
(compiler-note `(coerce (,prim-quick (coerce x 'double-float))
"Unable to avoid inline argument range check~@ 'single-float))
because the argument range (~s) was not within 2^64" (t
(type-specifier (continuation-type x))) (compiler-note
`(coerce (,prim (coerce x 'double-float)) 'single-float)))) "Unable to avoid inline argument range check~@
because the argument range (~s) was not within 2^64"
(type-specifier (continuation-type x)))
`(coerce (,prim (coerce x 'double-float)) 'single-float)))
`(coerce (,prim (coerce x 'double-float)) 'single-float)))
(deftransform name ((x) '(double-float) '* :eval-name t :when :both) (deftransform name ((x) '(double-float) '* :eval-name t :when :both)
(cond ((csubtypep (continuation-type x) (if (backend-featurep :x86)
(specifier-type '(double-float (#.(- (expt 2d0 64))) (cond ((csubtypep (continuation-type x)
(#.(expt 2d0 64))))) (specifier-type '(double-float
`(,prim-quick x)) (#.(- (expt 2d0 64)))
(t (#.(expt 2d0 64)))))
(compiler-note `(,prim-quick x))
"Unable to avoid inline argument range check~@ (t
because the argument range (~s) was not within 2^64" (compiler-note
(type-specifier (continuation-type x))) "Unable to avoid inline argument range check~@
`(,prim x)))))) because the argument range (~s) was not within 2^64"
(type-specifier (continuation-type x)))
`(,prim x)))
`(,prim x)))))
(dolist (stuff '((expt %pow t) (dolist (stuff '((expt %pow t)
(atan %atan2 t))) (atan %atan2 t)))
......
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