From cc7145cac2b298800b0650938d559c11c35caa24 Mon Sep 17 00:00:00 2001 From: Raymond Toy <toy.raymond@gmail.com> Date: Tue, 22 Jul 2014 08:09:42 -0700 Subject: [PATCH] Comment out all of the trig functions in lisp in favor of calling out to C. Also add interface to sincos function in C. This needs more testing and currently some tests fail. --- src/code/irrat.lisp | 18 ++++++++++++++++-- 1 file changed, 16 insertions(+), 2 deletions(-) diff --git a/src/code/irrat.lisp b/src/code/irrat.lisp index bcd40c36e..6d17c6c06 100644 --- a/src/code/irrat.lisp +++ b/src/code/irrat.lisp @@ -197,6 +197,20 @@ (y0 double-float :out) (y1 double-float :out)) +(declaim (inline %%sincos)) +(alien:def-alien-routine ("sincos" %%sincos) c-call:void + (x double-float) + (s double-float :out) + (c double-float :out)) + +(declaim (inline %sincos)) +(defun %sincos (x) + (declare (double-float x)) + (multiple-value-bind (ign s c) + (%%sincos x) + (values s c))) + +#|| ;; Implement sin/cos/tan in Lisp. These are based on the routines ;; from fdlibm. @@ -603,7 +617,7 @@ (let ((flag (- 1 (ash (logand n 1) 1)))) ;; flag = 1 if n even, -1 if n odd (kernel-tan y0 y1 flag))))))) - +||# ;; Compute sin and cos of x, simultaneously. (defun %sincos (x) (declare (double-float x) @@ -628,7 +642,7 @@ (3 (values (- (kernel-cos y0 y1)) (kernel-sin y0 y1 1)))))))) -(declaim (ext:end-block)) +;;(declaim (ext:end-block)) ;;;; Power functions. -- GitLab