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
6b8eae57
Commit
6b8eae57
authored
24 years ago
by
dtc
Browse files
Options
Downloads
Patches
Plain Diff
From Raymond Toy:
o Some cases of where the shift was a known constant were missed.
parent
d928e232
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/sparc/arith.lisp
+21
-17
21 additions, 17 deletions
compiler/sparc/arith.lisp
with
21 additions
and
17 deletions
compiler/sparc/arith.lisp
+
21
−
17
View file @
6b8eae57
...
...
@@ -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/sparc/arith.lisp,v 1.2
3
2001/01/
03 15:07:08
dtc Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/sparc/arith.lisp,v 1.2
4
2001/01/
19 23:19:12
dtc Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -399,7 +399,7 @@
(
:translate
ash
)
(
:policy
:fast-safe
)
(
:temporary
(
:sc
non-descriptor-reg
)
ndesc
)
(
:generator
3
(
:generator
5
(
sc-case
amount
(
signed-reg
(
cond
((
backend-featurep
:sparc-v9
)
...
...
@@ -447,17 +447,15 @@
(
frob
fast-ash/unsigned=>unsigned
unsigned-reg
unsigned-num
srl
))
;; Some special cases where we know we want a left shift. Just do the
;; shift, instead of checking for the sign of the shift. The case for
;; a known constant shift is handled very nicely by the fast-ash VOP
;; above, so there's nothing here for us to add.
;; shift, instead of checking for the sign of the shift.
(
macrolet
((
frob
(
name
sc-type
type
result-type
cost
)
`
(
define-vop
(
,
name
)
(
:note
"inline ASH"
)
(
:translate
ash
)
(
:args
(
number
:scs
(
,
sc-type
))
(
amount
:scs
(
unsigned-reg
)))
(
:arg-types
,
type
unsigned-
num
)
(
amount
:scs
(
signed-reg
unsigned-reg
immediate
)))
(
:arg-types
,
type
positive-fix
num
)
(
:results
(
result
:scs
(
,
result-type
)))
(
:result-types
,
type
)
(
:policy
:fast-safe
)
...
...
@@ -465,10 +463,16 @@
;; The result-type assures us that this shift will not
;; overflow. And for fixnum's, the zero bits that get
;; shifted in are just fine for the fixnum tag.
(
inst
sll
result
number
amount
)))))
(
frob
fast-ash-left/signed=>signed
signed-reg
signed-num
signed-reg
2
)
;;(frob fast-ash-left/fixnum=>signed any-reg tagged-num signed-reg 1)
(
frob
fast-ash-left/unsigned=>unsigned
unsigned-reg
unsigned-num
unsigned-reg
2
))
(
sc-case
amount
((
signed-reg
unsigned-reg
)
(
inst
sll
result
number
amount
))
(
immediate
(
let
((
amount
(
tn-value
amount
)))
(
assert
(
>=
amount
0
))
(
inst
sll
result
number
amount
))))))))
(
frob
fast-ash-left/signed=>signed
signed-reg
signed-num
signed-reg
3
)
(
frob
fast-ash-left/fixnum=>fixnum
any-reg
tagged-num
any-reg
2
)
(
frob
fast-ash-left/unsigned=>unsigned
unsigned-reg
unsigned-num
unsigned-reg
3
))
(
defknown
ash-right-signed
((
signed-byte
#.
vm:word-bits
)
(
and
fixnum
unsigned-byte
))
...
...
@@ -489,14 +493,14 @@
(
:note
"inline right ASH"
)
(
:translate
,
trans
)
(
:args
(
number
:scs
(
,
sc-type
))
(
amount
:scs
(
unsigned-reg
immediate
)))
(
:arg-types
,
type
unsigned-
num
)
(
amount
:scs
(
signed-reg
unsigned-reg
immediate
)))
(
:arg-types
,
type
positive-fix
num
)
(
:results
(
result
:scs
(
,
sc-type
)))
(
:result-types
,
type
)
(
:policy
:fast-safe
)
(
:generator
,
cost
(
sc-case
amount
(
unsigned-reg
(
(
signed-reg
unsigned-reg
)
(
inst
,
shift-inst
result
number
amount
))
(
immediate
(
let
((
amt
(
tn-value
amount
)))
...
...
@@ -510,8 +514,8 @@
(
:note
"inline right ASH"
)
(
:translate
ash-right-signed
)
(
:args
(
number
:scs
(
any-reg
))
(
amount
:scs
(
unsigned-reg
immediate
)))
(
:arg-types
tagged-num
unsigned-
num
)
(
amount
:scs
(
signed-reg
unsigned-reg
immediate
)))
(
:arg-types
tagged-num
positive-fix
num
)
(
:results
(
result
:scs
(
any-reg
)))
(
:result-types
tagged-num
)
(
:temporary
(
:sc
non-descriptor-reg
:target
result
)
temp
)
...
...
@@ -520,7 +524,7 @@
;; Shift the fixnum right by the desired amount. Then zap out the
;; 2 LSBs to make it a fixnum again. (Those bits are junk.)
(
sc-case
amount
(
unsigned-reg
(
(
signed-reg
unsigned-reg
)
(
inst
sra
temp
number
amount
))
(
immediate
(
inst
sra
temp
number
(
tn-value
amount
))))
...
...
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