From 6349f899f37ca9807461e67cb5e2f8b8bd3beba6 Mon Sep 17 00:00:00 2001 From: Nikodemus Siivola Date: Wed, 19 Apr 2006 14:16:05 +0000 Subject: [PATCH] 0.9.11.40: constant folding * Out-of-line versions for %SIN, %COS, and %TAN. --- NEWS | 3 +++ src/code/irrat.lisp | 3 +++ tests/float.pure.lisp | 6 ++++++ version.lisp-expr | 2 +- 4 files changed, 13 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index 0b7236a..22a5a9a 100644 --- a/NEWS +++ b/NEWS @@ -23,6 +23,9 @@ changes in sbcl-0.9.12 relative to sbcl-0.9.11: documentation on package locks for details. * enhancement: EVAL can process IF-expressions without resorting to the compiler. + * bug fix: Some operations involving SIN, COS, or TAN weren't being + constant-folded properly due to missing out-of-line functions. + (reported by Mika Pihlajamäki) * bug fix: LISTEN sometimes returned T even in cases where no data was immediately available from the stream * fixed bug: types of the last two arguments to SET-SYNTAX-FROM-CHAR diff --git a/src/code/irrat.lisp b/src/code/irrat.lisp index 1a38ed9..0f2b7a3 100644 --- a/src/code/irrat.lisp +++ b/src/code/irrat.lisp @@ -46,8 +46,11 @@ `(defun ,name ,ll (,name ,@ll)))) (def %atan2 (x y)) (def %atan (x)) + (def %tan (x)) (def %tan-quick (x)) + (def %cos (x)) (def %cos-quick (x)) + (def %sin (x)) (def %sin-quick (x)) (def %sqrt (x)) (def %log (x)) diff --git a/tests/float.pure.lisp b/tests/float.pure.lisp index 3d50fda..d06352c 100644 --- a/tests/float.pure.lisp +++ b/tests/float.pure.lisp @@ -118,6 +118,12 @@ #c(1.0d0 2.0d0)) 'double-float)) +;;; More out of line functions (%COS, %SIN, %TAN) for constant folding, +;;; reported by Mika Pihlajamäki +(funcall (compile nil '(lambda () (cos (tan (round 0)))))) +(funcall (compile nil '(lambda () (sin (tan (round 0)))))) +(funcall (compile nil '(lambda () (tan (tan (round 0)))))) + (with-test (:name (:addition-overflow :bug-372) :fails-on '(or :ppc :darwin :mips :freebsd)) (assert (typep (nth-value diff --git a/version.lisp-expr b/version.lisp-expr index b07f5a7..5732388 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.9.11.39" +"0.9.11.40" -- 1.7.10.4