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
9249e934
Commit
9249e934
authored
23 years ago
by
pw
Browse files
Options
Downloads
Patches
Plain Diff
DTC's fix for right shifting (unsigned-byte 32) values by amounts > 31 bits.
parent
41e757c0
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/x86/arith.lisp
+13
-10
13 additions, 10 deletions
compiler/x86/arith.lisp
with
13 additions
and
10 deletions
compiler/x86/arith.lisp
+
13
−
10
View file @
9249e934
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/arith.lisp,v 1.1
3
200
0/09/12 07:36:01 dtc
Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/x86/arith.lisp,v 1.1
4
200
1/11/03 22:27:01 pw
Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -652,7 +652,7 @@
(
inst
shl
result
:cl
)))
(
define-vop
(
fast-ash-c/unsigned=>unsigned
)
(
:translate
ash
)
(
:translate
ash
)
(
:policy
:fast-safe
)
(
:args
(
number
:scs
(
unsigned-reg
)
:target
result
:load-if
(
not
(
and
(
sc-is
number
unsigned-stack
)
...
...
@@ -679,8 +679,10 @@
;; We don't have to worry about overflow because of the
;; result type restriction.
(
inst
shl
result
amount
))
((
<
amount
-31
)
(
inst
mov
result
0
))
(
t
(
inst
shr
result
(
min
31
(
-
amount
))))))))
)
(
inst
shr
result
(
-
amount
))))))))
(
define-vop
(
fast-ash-c/signed=>signed
)
(
:translate
ash
)
...
...
@@ -761,7 +763,7 @@
(
inst
shl
result
:cl
)))
(
define-vop
(
fast-ash/unsigned=>unsigned
)
(
:translate
ash
)
(
:translate
ash
)
(
:policy
:fast-safe
)
(
:args
(
number
:scs
(
unsigned-reg
)
:target
result
)
(
amount
:scs
(
signed-reg
)
:target
ecx
))
...
...
@@ -774,19 +776,20 @@
(
move
result
number
)
(
move
ecx
amount
)
(
inst
or
ecx
ecx
)
(
inst
jmp
:ns
positive
)
(
inst
jmp
:ns
POSITIVE
)
(
inst
neg
ecx
)
(
inst
cmp
ecx
31
)
(
inst
jmp
:be
okay
)
(
inst
mov
ecx
31
)
(
inst
jmp
:be
OKAY
)
(
inst
xor
result
result
)
(
inst
jmp
DONE
)
OKAY
(
inst
shr
result
:cl
)
(
inst
jmp
done
)
(
inst
jmp
DONE
)
POSITIVE
;; The result-type assures us that this shift will not overflow.
(
inst
shl
result
:cl
)
DONE
))
(
define-vop
(
fast-ash/signed=>signed
)
...
...
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