X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Ffloat-tran.lisp;h=8ceae403629cd5d481804ef89f80aafab005569f;hb=1394636aef3b85be4fb6ef4a5424115aa2022d99;hp=2b2495d53eb24cf8edce8e881581e89cc93730e7;hpb=29a9ccc860532b32c566aec095f570e999a9c52c;p=sbcl.git diff --git a/src/compiler/float-tran.lisp b/src/compiler/float-tran.lisp index 2b2495d..8ceae40 100644 --- a/src/compiler/float-tran.lisp +++ b/src/compiler/float-tran.lisp @@ -347,11 +347,13 @@ (movable foldable flushable)) (defknown (%asin %atan) - (double-float) (double-float #.(- (/ pi 2)) #.(/ pi 2)) + (double-float) + (double-float #.(coerce (- (/ pi 2)) 'double-float) + #.(coerce (/ pi 2) 'double-float)) (movable foldable flushable)) (defknown (%acos) - (double-float) (double-float 0.0d0 #.pi) + (double-float) (double-float 0.0d0 #.(coerce pi 'double-float)) (movable foldable flushable)) (defknown (%cosh) @@ -375,7 +377,9 @@ (movable foldable flushable)) (defknown (%atan2) - (double-float double-float) (double-float #.(- pi) #.pi) + (double-float double-float) + (double-float #.(coerce (- pi) 'double-float) + #.(coerce pi 'double-float)) (movable foldable flushable)) (defknown (%scalb) @@ -390,29 +394,29 @@ (double-float) double-float (movable foldable flushable)) -(macrolet ((def-frob (name prim rtype) +(macrolet ((def (name prim rtype) `(progn (deftransform ,name ((x) (single-float) ,rtype) `(coerce (,',prim (coerce x 'double-float)) 'single-float)) (deftransform ,name ((x) (double-float) ,rtype :when :both) `(,',prim x))))) - (def-frob exp %exp *) - (def-frob log %log float) - (def-frob sqrt %sqrt float) - (def-frob asin %asin float) - (def-frob acos %acos float) - (def-frob atan %atan *) - (def-frob sinh %sinh *) - (def-frob cosh %cosh *) - (def-frob tanh %tanh *) - (def-frob asinh %asinh *) - (def-frob acosh %acosh float) - (def-frob atanh %atanh float)) + (def exp %exp *) + (def log %log float) + (def sqrt %sqrt float) + (def asin %asin float) + (def acos %acos float) + (def atan %atan *) + (def sinh %sinh *) + (def cosh %cosh *) + (def tanh %tanh *) + (def asinh %asinh *) + (def acosh %acosh float) + (def atanh %atanh float)) ;;; The argument range is limited on the x86 FP trig. functions. A ;;; post-test can detect a failure (and load a suitable result), but ;;; this test is avoided if possible. -(macrolet ((def-frob (name prim prim-quick) +(macrolet ((def (name prim prim-quick) (declare (ignorable prim-quick)) `(progn (deftransform ,name ((x) (single-float) *) @@ -442,9 +446,9 @@ (type-specifier (continuation-type x))) `(,',prim x))) #!-x86 `(,',prim x))))) - (def-frob sin %sin %sin-quick) - (def-frob cos %cos %cos-quick) - (def-frob tan %tan %tan-quick)) + (def sin %sin %sin-quick) + (def cos %cos %cos-quick) + (def tan %tan %tan-quick)) (deftransform atan ((x y) (single-float single-float) *) `(coerce (%atan2 (coerce x 'double-float) (coerce y 'double-float)) @@ -1285,7 +1289,7 @@ (defknown ,ufun (real) integer (movable foldable flushable)) (deftransform ,fun ((x &optional by) (* &optional - (constant-argument (member 1)))) + (constant-arg (member 1)))) '(let ((res (,ufun x))) (values res (- x res))))))) (define-frobs truncate %unary-truncate)