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
d1dc471d
Commit
d1dc471d
authored
33 years ago
by
wlott
Browse files
Options
Downloads
Patches
Plain Diff
Fixed the SAP routines to align the sap to a word boundry before using it.
parent
b543a03a
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
code/bit-bash.lisp
+29
-11
29 additions, 11 deletions
code/bit-bash.lisp
with
29 additions
and
11 deletions
code/bit-bash.lisp
+
29
−
11
View file @
d1dc471d
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
;;;
(
ext:file-comment
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/bit-bash.lisp,v 1.1
1
1991/0
4/28 01:10:2
9 wlott Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/bit-bash.lisp,v 1.1
2
1991/0
5/08 09:31:5
9 wlott Exp $"
)
;;;
;;;
;;; **********************************************************************
;;; **********************************************************************
;;;
;;;
...
@@ -106,7 +106,7 @@
...
@@ -106,7 +106,7 @@
(
ash
number
(
-
count
))
(
ash
number
(
-
count
))
(
ash
(
ldb
(
byte
(
-
unit-bits
count
)
0
)
number
)
count
)))))
(
ash
(
ldb
(
byte
(
-
unit-bits
count
)
0
)
number
)
count
)))))
(
proclaim
'
(
inline
start-mask
end-mask
))
(
proclaim
'
(
inline
start-mask
end-mask
fix-sap-and-offset
))
(
defun
start-mask
(
count
)
(
defun
start-mask
(
count
)
"Produce a mask that contains 1's for the COUNT ``start'' bits and 0's for
"Produce a mask that contains 1's for the COUNT ``start'' bits and 0's for
the remaining ``end'' bits. Only the lower 5 bits of COUNT are significant."
the remaining ``end'' bits. Only the lower 5 bits of COUNT are significant."
...
@@ -120,6 +120,14 @@
...
@@ -120,6 +120,14 @@
(
declare
(
fixnum
count
))
(
declare
(
fixnum
count
))
(
shift-towards-end
(
1-
(
ash
1
unit-bits
))
(
-
count
)))
(
shift-towards-end
(
1-
(
ash
1
unit-bits
))
(
-
count
)))
(
defun
fix-sap-and-offset
(
sap
offset
)
"Align the SAP to a word boundry, and update the offset accordingly."
(
declare
(
type
system-area-pointer
sap
)
(
type
index
offset
))
(
let
((
address
(
sap-int
sap
)))
(
values
(
int-sap
(
32bit-logical-andc2
address
3
))
(
+
(
*
(
logand
address
3
)
byte-bits
)
offset
))))
;;;; DO-CONSTANT-BIT-BASH
;;;; DO-CONSTANT-BIT-BASH
...
@@ -442,8 +450,10 @@
...
@@ -442,8 +450,10 @@
(
declare
(
type
unit
value
)
(
type
offset
dst-offset
length
))
(
declare
(
type
unit
value
)
(
type
offset
dst-offset
length
))
(
locally
(
locally
(
declare
(
optimize
(
speed
3
)
(
safety
0
)))
(
declare
(
optimize
(
speed
3
)
(
safety
0
)))
(
do-constant-bit-bash
dst
dst-offset
length
value
(
multiple-value-bind
(
dst
dst-offset
)
#'
sap-ref-32
#'
%set-sap-ref-32
)))
(
fix-sap-and-offset
dst
dst-offset
)
(
do-constant-bit-bash
dst
dst-offset
length
value
#'
sap-ref-32
#'
%set-sap-ref-32
))))
(
defun
bit-bash-copy
(
src
src-offset
dst
dst-offset
length
)
(
defun
bit-bash-copy
(
src
src-offset
dst
dst-offset
length
)
(
declare
(
type
offset
src-offset
dst-offset
length
))
(
declare
(
type
offset
src-offset
dst-offset
length
))
...
@@ -457,20 +467,28 @@
...
@@ -457,20 +467,28 @@
(
declare
(
type
offset
src-offset
dst-offset
length
))
(
declare
(
type
offset
src-offset
dst-offset
length
))
(
locally
(
locally
(
declare
(
optimize
(
speed
3
)
(
safety
0
)))
(
declare
(
optimize
(
speed
3
)
(
safety
0
)))
(
do-unary-bit-bash
src
src-offset
dst
dst-offset
length
(
multiple-value-bind
(
src
src-offset
)
#'
sap-ref-32
#'
%set-sap-ref-32
#'
sap-ref-32
)))
(
fix-sap-and-offset
src
src-offset
)
(
multiple-value-bind
(
dst
dst-offset
)
(
fix-sap-and-offset
dst
dst-offset
)
(
do-unary-bit-bash
src
src-offset
dst
dst-offset
length
#'
sap-ref-32
#'
%set-sap-ref-32
#'
sap-ref-32
)))))
(
defun
copy-to-system-area
(
src
src-offset
dst
dst-offset
length
)
(
defun
copy-to-system-area
(
src
src-offset
dst
dst-offset
length
)
(
declare
(
type
offset
src-offset
dst-offset
length
))
(
declare
(
type
offset
src-offset
dst-offset
length
))
(
locally
(
locally
(
declare
(
optimize
(
speed
3
)
(
safety
0
)))
(
declare
(
optimize
(
speed
3
)
(
safety
0
)))
(
do-unary-bit-bash
src
src-offset
dst
dst-offset
length
(
multiple-value-bind
(
dst
dst-offset
)
#'
sap-ref-32
#'
%set-sap-ref-32
#'
%raw-bits
)))
(
fix-sap-and-offset
dst
dst-offset
)
(
do-unary-bit-bash
src
src-offset
dst
dst-offset
length
#'
sap-ref-32
#'
%set-sap-ref-32
#'
%raw-bits
))))
(
defun
copy-from-system-area
(
src
src-offset
dst
dst-offset
length
)
(
defun
copy-from-system-area
(
src
src-offset
dst
dst-offset
length
)
(
declare
(
type
offset
src-offset
dst-offset
length
))
(
declare
(
type
offset
src-offset
dst-offset
length
))
(
locally
(
locally
(
declare
(
optimize
(
speed
3
)
(
safety
0
)))
(
declare
(
optimize
(
speed
3
)
(
safety
0
)))
(
do-unary-bit-bash
src
src-offset
dst
dst-offset
length
(
multiple-value-bind
(
src
src-offset
)
#'
%raw-bits
#'
%set-raw-bits
#'
sap-ref-32
)))
(
fix-sap-and-offset
src
src-offset
)
(
do-unary-bit-bash
src
src-offset
dst
dst-offset
length
#'
%raw-bits
#'
%set-raw-bits
#'
sap-ref-32
))))
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