Commit 2527de5e authored by Raymond Toy's avatar Raymond Toy
Browse files

Make %sincos consistently return sin and cos instead of cos and sin.

Update users accordingly.
parent d669c129
...@@ -342,24 +342,25 @@ ...@@ -342,24 +342,25 @@
(- c (* s y)))) (- c (* s y))))
(case (logand n 3) (case (logand n 3)
(0 (0
(values (cos2 s c y1) (values (sin2 s c y1)
(sin2 s c y1)))
(values (- (sin2 s c y1))
(cos2 s c y1))) (cos2 s c y1)))
(2 (1
(values (- (cos2 s c y1)) (values (cos2 s c y1)
(- (sin2 s c y1)))) (- (sin2 s c y1))))
(values (- (sin2 s c y1))
(- (cos2 s c y1))))
(3 (3
(values (sin2 s c y1) (values (- (cos2 s c y1))
(- (cos2 s c y1))))))))) (sin2 s c y1))))))))
#+sparc #+sparc
(declaim (inline %sinccos)) (declaim (inline %sinccos))
#+sparc #+sparc
(defun %sincos (theta) (defun %sincos (theta)
(multiple-value-bind (ignore s c) (multiple-value-bind (ignore s c)
(%%sincos theta) (%%sincos theta)
(values c s))) (declare (ignore ignore))
(values s c)))
) )
...@@ -1025,13 +1026,13 @@ ...@@ -1025,13 +1026,13 @@
(let ((arg (coerce theta 'double-float))) (let ((arg (coerce theta 'double-float)))
(multiple-value-bind (s c) (multiple-value-bind (s c)
(%sincos arg) (%sincos arg)
(complex (coerce s 'single-float) (complex (coerce c 'single-float)
(coerce c 'single-float))))) (coerce s 'single-float)))))
(((foreach single-float double-float)) (((foreach single-float double-float))
(multiple-value-bind (s c) (multiple-value-bind (s c)
(%sincos (coerce theta 'double-float)) (%sincos (coerce theta 'double-float))
(complex (coerce s '(dispatch-type theta)) (complex (coerce c '(dispatch-type theta))
(coerce c '(dispatch-type theta))))) (coerce s '(dispatch-type theta)))))
#+double-double #+double-double
((double-double-float) ((double-double-float)
(complex (cos theta) (sin theta)))))) (complex (cos theta) (sin theta))))))
...@@ -740,14 +740,13 @@ ...@@ -740,14 +740,13 @@
(deftransform cis ((x) (single-float) * :when :both) (deftransform cis ((x) (single-float) * :when :both)
`(multiple-value-bind (s c) `(multiple-value-bind (s c)
(kernel::%sincos (coerce x 'double-float)) (kernel::%sincos (coerce x 'double-float))
(complex (coerce s 'single-float) (complex (coerce c 'single-float)
(coerce c 'single-float)))) (coerce s 'single-float))))
(deftransform cis ((x) (double-float) * :when :both) (deftransform cis ((x) (double-float) * :when :both)
`(multiple-value-bind (ignore s c) `(multiple-value-bind (s c)
(kernel::%%sincos x) (kernel::%sincos x)
(declare (ignore ignore)) (complex c s)))
(complex s c)))
#+double-double #+double-double
(deftransform cis ((z) (double-double-float) *) (deftransform cis ((z) (double-double-float) *)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment