Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
cmucl
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Carl Shapiro
cmucl
Commits
0dde62a3
Commit
0dde62a3
authored
24 years ago
by
dtc
Browse files
Options
Downloads
Patches
Plain Diff
Move the Sparc V9 fast max/min stuff to sparc/float.lisp.
parent
e94e75e0
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
compiler/srctran.lisp
+1
-112
1 addition, 112 deletions
compiler/srctran.lisp
with
1 addition
and
112 deletions
compiler/srctran.lisp
+
1
−
112
View file @
0dde62a3
...
...
@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/srctran.lisp,v 1.10
2
2000/09/
12 07:37
:3
9
dtc Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/srctran.lisp,v 1.10
3
2000/09/
26 15:13
:3
1
dtc Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -3500,117 +3500,6 @@
)
#+
sparc-v9
(
progn
;;; The sparc-v9 architecture has conditional move instructions that
;;; can be used. This should be faster than using the obvious if
;;; expression since we don't have to do branches.
;; Tell the compiler about these functions.
(
defknown
%max
(
real
real
)
real
(
movable
foldable
flushable
))
(
defknown
%min
(
real
real
)
real
(
movable
foldable
flushable
))
;; Needed for the byte-compiled stuff and constant folding since we've
;; declared these as foldable functions.
(
defun
%max
(
x
y
)
(
%max
x
y
))
(
defun
%min
(
x
y
)
(
%min
x
y
))
;; Convert max/min of many args into the obvious set of nested max/min's.
(
def-source-transform
max
(
arg
&rest
more-args
)
(
cond
((
null
more-args
)
`
(
values
,
arg
))
(
t
`
(
%max
,
arg
(
max
,@
more-args
)))))
(
def-source-transform
min
(
arg
&rest
more-args
)
(
cond
((
null
more-args
)
`
(
values
,
arg
))
(
t
`
(
%min
,
arg
(
min
,@
more-args
)))))
;; Derive the types of %max and %min
(
defoptimizer
(
%max
derive-type
)
((
x
y
))
(
multiple-value-bind
(
definitely-<
definitely->=
)
(
ir1-transform-<-helper
x
y
)
(
cond
(
definitely-<
(
continuation-type
y
))
(
definitely->=
(
continuation-type
x
))
(
t
(
make-canonical-union-type
(
list
(
continuation-type
x
)
(
continuation-type
y
)))))))
(
defoptimizer
(
%min
derive-type
)
((
x
y
))
(
multiple-value-bind
(
definitely-<
definitely->=
)
(
ir1-transform-<-helper
x
y
)
(
cond
(
definitely-<
(
continuation-type
x
))
(
definitely->=
(
continuation-type
y
))
(
t
(
make-canonical-union-type
(
list
(
continuation-type
x
)
(
continuation-type
y
)))))))
(
deftransform
%max
((
x
y
)
(
real
real
)
*
:when
:both
)
(
let
((
x-type
(
continuation-type
x
))
(
y-type
(
continuation-type
y
))
(
signed
(
specifier-type
'
(
signed-byte
32
)))
(
unsigned
(
specifier-type
'
(
unsigned-byte
32
)))
(
d-float
(
specifier-type
'double-float
))
(
s-float
(
specifier-type
'single-float
)))
;; Use %%max if both args are good types of the same type. As a
;; last resort, use the obvious comparison to select the desired
;; element.
(
cond
((
or
(
and
(
csubtypep
x-type
signed
)
(
csubtypep
y-type
signed
))
(
and
(
csubtypep
x-type
unsigned
)
(
csubtypep
y-type
unsigned
))
(
and
(
csubtypep
x-type
d-float
)
(
csubtypep
y-type
d-float
))
(
and
(
csubtypep
x-type
s-float
)
(
csubtypep
y-type
s-float
)))
`
(
sparc::%%max
x
y
))
(
t
(
let
((
arg1
(
gensym
))
(
arg2
(
gensym
)))
`
(
let
((
,
arg1
x
)
(
,
arg2
y
))
(
if
(
>
,
arg1
,
arg2
)
,
arg1
,
arg2
)))))))
(
deftransform
%min
((
x
y
)
(
real
real
)
*
:when
:both
)
(
let
((
x-type
(
continuation-type
x
))
(
y-type
(
continuation-type
y
))
(
signed
(
specifier-type
'
(
signed-byte
32
)))
(
unsigned
(
specifier-type
'
(
unsigned-byte
32
)))
(
d-float
(
specifier-type
'double-float
))
(
s-float
(
specifier-type
'single-float
)))
(
cond
((
or
(
and
(
csubtypep
x-type
signed
)
(
csubtypep
y-type
signed
))
(
and
(
csubtypep
x-type
unsigned
)
(
csubtypep
y-type
unsigned
))
(
and
(
csubtypep
x-type
d-float
)
(
csubtypep
y-type
d-float
))
(
and
(
csubtypep
x-type
s-float
)
(
csubtypep
y-type
s-float
)))
`
(
sparc::%%min
x
y
))
(
t
(
let
((
arg1
(
gensym
))
(
arg2
(
gensym
)))
`
(
let
((
,
arg1
x
)
(
,
arg2
y
))
(
if
(
<
,
arg1
,
arg2
)
,
arg1
,
arg2
)))))))
)
;;;; Converting N-arg arithmetic functions:
;;;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
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!
Save comment
Cancel
Please
register
or
sign in
to comment