[cmucl-commit] [git] CMU Common Lisp branch master updated. snapshot-2014-06-22-g3533a13
Raymond Toy
rtoy at common-lisp.net
Sat Jul 26 05:21:07 UTC 2014
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 3533a13a8cc53e43a7c4d7d27b3e6b8bcc004672 (commit)
via 250d2511450366c4e9f07c1515f04ccaf37ebf68 (commit)
from b6bd0b590e541a159c4b5eb7e31b64c2ef0b47dc (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 3533a13a8cc53e43a7c4d7d27b3e6b8bcc004672
Author: Raymond Toy <toy.raymond at gmail.com>
Date: Fri Jul 25 22:17:11 2014 -0700
Rename sin/cos/tan/sincos so we don't collide with libm.
Update def-math-rtn to allow specifying the C function name and the
lisp function name so we can use def-math-rtn with the new trig
functions.
diff --git a/src/code/irrat.lisp b/src/code/irrat.lisp
index f2b0e9b..032a6ac 100644
--- a/src/code/irrat.lisp
+++ b/src/code/irrat.lisp
@@ -28,13 +28,17 @@
;;; call, and saves number consing to boot.
;;;
(defmacro def-math-rtn (name num-args)
- (let ((function (intern (concatenate 'simple-string
+ (multiple-value-bind (c-name lisp-name)
+ (if (listp name)
+ (values (first name) (second name))
+ (values name
+ (intern (concatenate 'simple-string
"%"
(string-upcase name)))))
`(progn
- (declaim (inline ,function))
- (export ',function)
- (alien:def-alien-routine (,name ,function) double-float
+ (declaim (inline ,lisp-name))
+ (export ',lisp-name)
+ (alien:def-alien-routine (,c-name ,lisp-name) double-float
,@(let ((results nil))
(dotimes (i num-args (nreverse results))
(push (list (intern (format nil "ARG-~D" i))
@@ -65,9 +69,12 @@
;; For x86 (without sse2), we can use x87 instructions to implement
;; these. With sse2, we don't currently support that, so these
;; should be disabled.
- (def-math-rtn "sin" 1)
- (def-math-rtn "cos" 1)
- (def-math-rtn "tan" 1)
+;; (def-math-rtn "sin" 1)
+;; (def-math-rtn "cos" 1)
+ ;; (def-math-rtn "tan" 1)
+ (def-math-rtn ("fdlibm_sin" %sin) 1)
+ (def-math-rtn ("fdlibm_cos" %cos) 1)
+ (def-math-rtn ("fdlibm_tan" %tan) 1)
(def-math-rtn "atan" 1)
(def-math-rtn "atan2" 2))
(def-math-rtn "asin" 1)
@@ -198,7 +205,7 @@
(y1 double-float :out))
(declaim (inline %%sincos))
-(alien:def-alien-routine ("sincos" %%sincos) c-call:void
+(alien:def-alien-routine ("lisp_sincos" %%sincos) c-call:void
(x double-float)
(s double-float :out)
(c double-float :out))
diff --git a/src/lisp/s_cos.c b/src/lisp/s_cos.c
index a897133..9ae05d8 100644
--- a/src/lisp/s_cos.c
+++ b/src/lisp/s_cos.c
@@ -45,9 +45,9 @@
#include "fdlibm.h"
#ifdef __STDC__
- double cos(double x)
+ double fdlibm_cos(double x)
#else
- double cos(x)
+ double fdlibm_cos(x)
double x;
#endif
{
diff --git a/src/lisp/s_sin.c b/src/lisp/s_sin.c
index 1dba1c8..a7ad61d 100644
--- a/src/lisp/s_sin.c
+++ b/src/lisp/s_sin.c
@@ -45,9 +45,9 @@
#include "fdlibm.h"
#ifdef __STDC__
- double sin(double x)
+ double fdlibm_sin(double x)
#else
- double sin(x)
+ double fdlibm_sin(x)
double x;
#endif
{
diff --git a/src/lisp/s_tan.c b/src/lisp/s_tan.c
index 4761a4c..0b90762 100644
--- a/src/lisp/s_tan.c
+++ b/src/lisp/s_tan.c
@@ -44,9 +44,9 @@
#include "fdlibm.h"
#ifdef __STDC__
- double tan(double x)
+ double fdlibm_tan(double x)
#else
- double tan(x)
+ double fdlibm_tan(x)
double x;
#endif
{
diff --git a/src/lisp/sincos.c b/src/lisp/sincos.c
index f5db8b3..edd0eca 100644
--- a/src/lisp/sincos.c
+++ b/src/lisp/sincos.c
@@ -1,6 +1,6 @@
#include "fdlibm.h"
-void sincos (double x, double *s, double *c)
+void lisp_sincos (double x, double *s, double *c)
{
int ix;
union { int i[2]; double d; } ux;
commit 250d2511450366c4e9f07c1515f04ccaf37ebf68
Author: Raymond Toy <toy.raymond at gmail.com>
Date: Fri Jul 25 21:08:05 2014 -0700
Add declaration to ignore unused variable.
diff --git a/src/code/irrat.lisp b/src/code/irrat.lisp
index f95e32c..f2b0e9b 100644
--- a/src/code/irrat.lisp
+++ b/src/code/irrat.lisp
@@ -208,6 +208,7 @@
(declare (double-float x))
(multiple-value-bind (ign s c)
(%%sincos x)
+ (declare (ignore ign))
(values s c)))
#||
-----------------------------------------------------------------------
Summary of changes:
src/code/irrat.lisp | 24 ++++++++++++++++--------
src/lisp/s_cos.c | 4 ++--
src/lisp/s_sin.c | 4 ++--
src/lisp/s_tan.c | 4 ++--
src/lisp/sincos.c | 2 +-
5 files changed, 23 insertions(+), 15 deletions(-)
hooks/post-receive
--
CMU Common Lisp
More information about the cmucl-commit
mailing list