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
86e78b06
Commit
86e78b06
authored
18 years ago
by
rtoy
Browse files
Options
Downloads
Patches
Plain Diff
Implement faster logcount, using same algorithm as Sparc.
parent
f01ef6a2
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/ppc/arith.lisp
+26
-1
26 additions, 1 deletion
compiler/ppc/arith.lisp
with
26 additions
and
1 deletion
compiler/ppc/arith.lisp
+
26
−
1
View file @
86e78b06
...
@@ -7,7 +7,7 @@
...
@@ -7,7 +7,7 @@
;;; Scott Fahlman (FAHLMAN@CMUC).
;;; Scott Fahlman (FAHLMAN@CMUC).
;;; **********************************************************************
;;; **********************************************************************
;;;
;;;
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/arith.lisp,v 1.1
1
2006/
05/07 23:50:00
rtoy Exp $
;;; $Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/compiler/ppc/arith.lisp,v 1.1
2
2006/
11/30 02:56:17
rtoy Exp $
;;;
;;;
;;; This file contains the VM definition arithmetic VOPs for the MIPS.
;;; This file contains the VM definition arithmetic VOPs for the MIPS.
;;;
;;;
...
@@ -458,6 +458,7 @@
...
@@ -458,6 +458,7 @@
(
inst
slwi
shift
shift
2
)
(
inst
slwi
shift
shift
2
)
(
inst
subfic
res
shift
(
fixnumize
32
))))
(
inst
subfic
res
shift
(
fixnumize
32
))))
#+
nil
(
define-vop
(
unsigned-byte-32-count
)
(
define-vop
(
unsigned-byte-32-count
)
(
:translate
logcount
)
(
:translate
logcount
)
(
:note
"inline (unsigned-byte 32) logcount"
)
(
:note
"inline (unsigned-byte 32) logcount"
)
...
@@ -482,6 +483,30 @@
...
@@ -482,6 +483,30 @@
(
emit-label
done
))))
(
emit-label
done
))))
(
define-vop
(
unsigned-byte-32-count
)
(
:translate
logcount
)
(
:note
"inline (unsigned-byte 32) logcount"
)
(
:policy
:fast-safe
)
(
:args
(
arg
:scs
(
unsigned-reg
)))
(
:arg-types
unsigned-num
)
(
:results
(
res
:scs
(
unsigned-reg
)))
(
:result-types
positive-fixnum
)
(
:temporary
(
:scs
(
non-descriptor-reg
)
:from
(
:argument
0
))
mask
temp
)
(
:generator
35
(
move
res
arg
)
(
dolist
(
stuff
'
((
1
#x55555555
)
(
2
#x33333333
)
(
4
#x0f0f0f0f
)
(
8
#x00ff00ff
)
(
16
#x0000ffff
)))
(
destructuring-bind
(
shift
bit-mask
)
stuff
;; Set mask
(
inst
lr
mask
bit-mask
)
(
inst
and
temp
res
mask
)
(
inst
srwi
res
res
shift
)
(
inst
and
res
res
mask
)
(
inst
add
res
res
temp
)))))
;;;; Binary conditional VOPs:
;;;; Binary conditional VOPs:
...
...
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