Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
cmucl
cmucl
Commits
06300c81
Commit
06300c81
authored
Dec 07, 2013
by
Raymond Toy
Browse files
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.
parent
881903dd
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/code/irrat.lisp
View file @
06300c81
...
...
@@ -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
)))
...
...
src/compiler/float-tran.lisp
View file @
06300c81
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment