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
52445f0e
Commit
52445f0e
authored
20 years ago
by
rtoy
Browse files
Options
Downloads
Patches
Plain Diff
Implement one-at-a-time hash for x86, as for sparc.
A simple cross-compile is needed.
parent
d1b58751
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
assembly/x86/array.lisp
+65
-1
65 additions, 1 deletion
assembly/x86/array.lisp
bootfiles/18e/boot23-sxhash.lisp
+3
-0
3 additions, 0 deletions
bootfiles/18e/boot23-sxhash.lisp
with
68 additions
and
1 deletion
assembly/x86/array.lisp
+
65
−
1
View file @
52445f0e
...
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman or slisp-group@cs.cmu.edu.
;;;
(
ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/assembly/x86/array.lisp,v 1.
8
200
3
/0
8
/0
3 1
1:27:5
0 gerd
Exp $"
)
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/assembly/x86/array.lisp,v 1.
9
200
4
/0
4
/0
7 0
1:27:5
3 rtoy
Exp $"
)
;;;
;;; **********************************************************************
;;;
...
...
@@ -63,6 +63,7 @@
(
loadw
length
string
vector-length-slot
other-pointer-type
)
(
inst
jmp
(
make-fixup
'sxhash-simple-substring
:assembly-routine
)))
#+
nil
(
define-assembly-routine
(
sxhash-simple-substring
(
:translate
%sxhash-simple-substring
)
(
:policy
:fast-safe
)
...
...
@@ -128,3 +129,66 @@
;; Force result to be a positive fixnum.
(
inst
and
result
#x7ffffffc
)
(
inst
ret
))
(
define-assembly-routine
(
sxhash-simple-substring
(
:translate
%sxhash-simple-substring
)
(
:policy
:fast-safe
)
(
:arg-types
*
positive-fixnum
)
(
:result-types
positive-fixnum
))
((
:arg
string
descriptor-reg
ebx-offset
)
(
:arg
length
any-reg
edi-offset
)
(
:res
result
any-reg
edx-offset
)
(
:temp
esi
unsigned-reg
esi-offset
)
(
:temp
ecx
unsigned-reg
ecx-offset
)
(
:temp
eax
unsigned-reg
eax-offset
))
;; Compute a pointer to where we are going to be extracting the bits.
(
inst
lea
esi
(
make-ea
:byte
:base
string
:disp
(
-
(
*
vector-data-offset
word-bytes
)
other-pointer-type
)))
;; Initialize the result.
(
inst
xor
result
result
)
;; Get the count. If it's zero, blow out.
(
inst
mov
ecx
length
)
(
inst
jecxz
done
)
(
inst
shr
ecx
2
)
; Convert fixnum to byte count
;; Clear the direction flag, so we advance through memory.
(
inst
cld
)
LOOP
;; Merge each successive word with the result.
(
inst
movzx
eax
(
make-ea
:byte
:base
esi-tn
))
(
inst
inc
esi
)
;; hash += key[i]
(
inst
add
result
eax
)
;; hash += (hash << 10)
(
move
eax
result
)
(
inst
shl
eax
10
)
(
inst
add
result
eax
)
;; hash ^= (hash >> 6)
(
move
eax
result
)
(
inst
shr
eax
6
)
(
inst
xor
result
eax
)
(
inst
loop
loop
)
;; hash += (hash << 3)
(
move
eax
result
)
(
inst
shl
eax
3
)
(
inst
add
result
eax
)
;; hash ^= (hash >> 11)
(
move
eax
result
)
(
inst
shr
eax
11
)
(
inst
xor
result
eax
)
;; hash += (hash << 15)
(
move
eax
result
)
(
inst
shl
eax
15
)
(
inst
add
result
eax
)
DONE
;; Force result to be a positive fixnum.
(
inst
and
result
#x7ffffffc
)
(
inst
ret
))
This diff is collapsed.
Click to expand it.
bootfiles/18e/boot23-sxhash.lisp
+
3
−
0
View file @
52445f0e
...
...
@@ -4,3 +4,6 @@
#+
sparc
(
load
"target:tools/cross-scripts/cross-sparc-sparc"
)
#+
x86
(
load
"target:tools/cross-scripts/cross-x86-x86"
)
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