[cmucl-commit] [git] CMU Common Lisp branch master updated. snapshot-2013-11-10-g06300c8

Raymond Toy rtoy at common-lisp.net
Sun Dec 8 01:41:25 UTC 2013


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "CMU Common Lisp".

The branch, master has been updated
       via  06300c812a5dfeecc9afd43d45608356f7c80dd6 (commit)
      from  881903dddf1e3f8feed193981b0ad7af5c4cd030 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 06300c812a5dfeecc9afd43d45608356f7c80dd6
Author: Raymond Toy <toy.raymond at gmail.com>
Date:   Sat Dec 7 17:41:17 2013 -0800

    Sparc has sincos in its C library.  Use it.  But note that it has
    accurate pi-reduction so we don't have do it ourselves.

diff --git a/src/code/irrat.lisp b/src/code/irrat.lisp
index d1e9a26..8e17a45 100644
--- a/src/code/irrat.lisp
+++ b/src/code/irrat.lisp
@@ -309,10 +309,11 @@
   #+(or ppc sse2)
   (frob %%sin %%cos %%tan))
 
-;; Linux has a sincos function in the C library. Use it.  But we need
-;; to do pi reduction ourselves because the C library doesn't do
-;; accurate reduction.
-#+(or (and linux x86))
+;; Linux and sparc have a sincos function in the C library. Use it.
+;; But on linux we need to do pi reduction ourselves because the C
+;; library doesn't do accurate reduction.  Sparc does accurate pi
+;; reduction, so we don't need to do it ourselves.
+#+(or (and linux x86) sparc)
 (progn
 (declaim (inline %%sincos))
 (export '%%sincos)
@@ -321,6 +322,7 @@
   (sin double-float :out)
   (cos double-float :out))
 
+#+(and linux x86)
 (defun %sincos (theta)
   (declare (double-float theta))
   ;; Accurately reduce theta.
@@ -351,7 +353,16 @@
 	  (3
 	   (values (sin2 s c y1)
 		   (- (cos2 s c y1)))))))))
+#+sparc
+(declaim (inline %sinccos))
+#+sparc
+(defun %sincos (theta)
+  (multiple-value-bind (ignore s c)
+      (%%sincos theta)
+    (values c s)))
 )
+
+
 
 ;;;; Power functions.
 
@@ -1006,9 +1017,9 @@
   "Return cos(Theta) + i sin(Theta), AKA exp(i Theta)."
   (if (complexp theta)
       (error (intl:gettext "Argument to CIS is complex: ~S") theta)
-      #-(or (and linux x86))
+      #-(or (and linux x86) sparc)
       (complex (cos theta) (sin theta))
-      #+(or (and linux x86))
+      #+(or (and linux x86) sparc)
       (number-dispatch ((theta real))
 	((rational)
 	 (let ((arg (coerce theta 'double-float)))
diff --git a/src/compiler/float-tran.lisp b/src/compiler/float-tran.lisp
index ecca5f1..fba199b 100644
--- a/src/compiler/float-tran.lisp
+++ b/src/compiler/float-tran.lisp
@@ -731,7 +731,7 @@
     (deftransform name ((x) '(double-float) rtype :eval-name t :when :both)
       `(,prim x))))
 
-#+(or (and linux x86))
+#+(or (and linux x86) sparc)
 (progn
 (defknown (kernel::%sincos)
     (double-float) (values double-float double-float)

-----------------------------------------------------------------------

Summary of changes:
 src/code/irrat.lisp          |   23 +++++++++++++++++------
 src/compiler/float-tran.lisp |    2 +-
 2 files changed, 18 insertions(+), 7 deletions(-)


hooks/post-receive
-- 
CMU Common Lisp


More information about the cmucl-commit mailing list