projects
/
mit-scheme.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a828e08
)
Fix sign error and mask size in fix:bitcount16.
author
Taylor R Campbell
<campbell@mumble.net>
Fri, 14 Dec 2018 17:05:50 +0000
(17:05 +0000)
committer
Taylor R Campbell
<campbell@mumble.net>
Sat, 15 Dec 2018 22:33:22 +0000
(22:33 +0000)
src/runtime/random.scm
patch
|
blob
|
history
diff --git
a/src/runtime/random.scm
b/src/runtime/random.scm
index 7a4e30cc002a763c952470497041dc47e5f120ab..14be33598d03aaa1f16887066bc74f03530ea59c 100644
(file)
--- a/
src/runtime/random.scm
+++ b/
src/runtime/random.scm
@@
-353,12
+353,12
@@
USA.
(define (fix:bitcount16 x)
(let* ((x1 (fix:- x (fix:and (fix:lsh x -1) #x5555)))
(x2 (fix:+ (fix:and (fix:lsh x1 -2) #x3333) (fix:and x1 #x3333)))
- (x3 (fix:and (fix:+ x2 (fix:lsh x2 4)) #x0f0f))
+ (x3 (fix:and (fix:+ x2 (fix:lsh x2
-
4)) #x0f0f))
(c0 x3)
(c1 (fix:lsh x3 -8))
(s (fix:+ c0 c1)))
(declare (integrate x1 x2 x3 x4 c0 c1 s))
- (fix:and s #xf)))
+ (fix:and s #x
1
f)))
(declare (integrate-operator fix:clz16))
(define (fix:clz16 x)