Raymond Toy pushed to branch master at cmucl / cmucl
Commits: 395af224 by Raymond Toy at 2017-12-29T15:57:59-08:00 RANDOM should do the same as the deftransform would do.
Make RANDOM compute the value the same way as the deftransform would do when the arg is a 32-bit integer.
The deftransform is still currently disabled for random-xoroshiro, though.
- - - - -
1 changed file:
- src/code/rand-xoroshiro.lisp
Changes:
===================================== src/code/rand-xoroshiro.lisp ===================================== --- a/src/code/rand-xoroshiro.lisp +++ b/src/code/rand-xoroshiro.lisp @@ -474,8 +474,11 @@ (declare (inline %random-single-float %random-double-float)) (cond ((typep arg '(integer 1 #x100000000)) - ;; Let the compiler deftransform take care of this case. - (%random-integer arg state)) + ;; Do the same thing as the deftransform would do. + (if (= arg (expt 2 32)) + (random-chunk state) + (values (bignum::%multiply (random-chunk state) + arg)))) ((and (typep arg 'single-float) (> arg 0.0F0)) (%random-single-float arg state)) ((and (typep arg 'double-float) (> arg 0.0D0))
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/395af2246b028691a323c1fcba...
--- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/395af2246b028691a323c1fcba... You're receiving this email because of your account on gitlab.common-lisp.net.