From: Taylor R Campbell Date: Fri, 14 Dec 2018 17:05:50 +0000 (+0000) Subject: Fix sign error and mask size in fix:bitcount16. X-Git-Tag: mit-scheme-pucked-10.1.9~3^2~35^2~11 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=a15c4d7a089e2480cc8e6c31d469a2c995d2578a;p=mit-scheme.git Fix sign error and mask size in fix:bitcount16. --- diff --git a/src/runtime/random.scm b/src/runtime/random.scm index 7a4e30cc0..14be33598 100644 --- 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 #x1f))) (declare (integrate-operator fix:clz16)) (define (fix:clz16 x)