Raymond Toy pushed to branch rtoy-xoro-default at cmucl / cmucl
Commits: 96c58393 by Raymond Toy at 2017-12-27T09:46:59-08:00 Modify random-state-jump to use 32-bit ints
Break the constants in the jump function into 32-bit chunks so we operate on 32-bit integers instead of 64-bit integers.
This is a minor optimization.
- - - - -
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 @@ -485,9 +485,12 @@ (s1-1 0)) (declare (type (unsigned-byte 32) s0-0 s0-1 s1-0 s1-1) (optimize (speed 3) (safety 0))) - (dolist (jump '(#xbeac0467eba5facb #xd86b048b86aa9922)) - (declare (type (unsigned-byte 64) jump)) - (dotimes (b 64) + ;; The constants are #xbeac0467eba5facb and #xd86b048b86aa9922, + ;; and we process these numbers starting from the LSB. We want ot + ;; process these in 32-bit chunks, so word-reverse the constants. + (dolist (jump '(#xeba5facb #xbeac0467 #x86aa9922 #xd86b048b)) + (declare (type (unsigned-byte 32) jump)) + (dotimes (b 32) (declare (fixnum b)) (when (logbitp b jump) (multiple-value-bind (x1 x0)
View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/96c58393bebcf502919736ca2e...
--- View it on GitLab: https://gitlab.common-lisp.net/cmucl/cmucl/commit/96c58393bebcf502919736ca2e... You're receiving this email because of your account on gitlab.common-lisp.net.